Commit 85c087df authored by Joan Pascual Sana's avatar Joan Pascual Sana

Write tests: unauth, auth, and v2 methods

parent 8883db43
# coding: utf-8
"""
RetroShare OpenApi wrapper
RetroShare OpenApi wrapper generated using Doxygen documentation # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.models.req_json_api_server_authorize_token import ReqJsonApiServerAuthorizeToken # noqa: E501
from openapi_client.rest import ApiException
class TestReqJsonApiServerVersion(unittest.TestCase):
"""ReqJsonApiServerAuthorizeToken unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testReqJsonApiServerVersion(self):
"""Test ReqJsonApiServerVersion"""
# Create an instance of the API class
api_instance = openapi_client.DefaultApi()
try:
# Write version information to given paramethers
api_response = api_instance.json_api_server_version()
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->json_api_server_version: %s\n" % e)
# FIXME: construct object with mandatory attributes with example values
# model = openapi_client.models.req_json_api_server_authorize_token.ReqJsonApiServerAuthorizeToken() # noqa: E501
pass
if __name__ == '__main__':
unittest.main()
......@@ -17,6 +17,7 @@ import unittest
import openapi_client
from openapi_client.models.req_rs_gxs_channels_create_channel_v2 import ReqRsGxsChannelsCreateChannelV2 # noqa: E501
from openapi_client.rest import ApiException
from test import API_INSTANCE
class TestReqRsGxsChannelsCreateChannelV2(unittest.TestCase):
......@@ -30,8 +31,25 @@ class TestReqRsGxsChannelsCreateChannelV2(unittest.TestCase):
def testReqRsGxsChannelsCreateChannelV2(self):
"""Test ReqRsGxsChannelsCreateChannelV2"""
# FIXME: construct object with mandatory attributes with example values
# model = openapi_client.models.req_rs_gxs_channels_create_channel_v2.ReqRsGxsChannelsCreateChannelV2() # noqa: E501
api_instance = API_INSTANCE
req_rs_gxs_channels_create_channel_v2 = {"name": "TestChannelV2 1",
"description": "( string)Description of the channel",
# "thumbnail": "( RsGxsImage)Optional image to show as channel thumbnail.",
# "authorId": "( RsGxsId)Optional id of the author. Leave empty for an anonymous channel.",
# "circleType": "( RsGxsCircleType)Optional visibility rule, default public.",
# "circleId": "( RsGxsCircleId)If the channel is not public specify the id of the circle who can see the channel. Depending on the value you pass for circleType this should be be an external circle if EXTERNAL is passed, a local friend group id if NODES_GROUP is passed, empty otherwise."
} # ReqRsGxsChannelsCreateChannelV2 | name: ( string)Name of the channel description: ( string)Description of the channel thumbnail: ( RsGxsImage)Optional image to show as channel thumbnail. authorId: ( RsGxsId)Optional id of the author. Leave empty for an anonymous channel. circleType: ( RsGxsCircleType)Optional visibility rule, default public. circleId: ( RsGxsCircleId)If the channel is not public specify the id of the circle who can see the channel. Depending on the value you pass for circleType this should be be an external circle if EXTERNAL is passed, a local friend group id if NODES_GROUP is passed, empty otherwise. (optional)
try:
# Create channel. Blocking API.
api_response = api_instance.rs_gxs_channels_create_channel_v2(
req_rs_gxs_channels_create_channel_v2=req_rs_gxs_channels_create_channel_v2)
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->rs_gxs_channels_create_channel_v2: %s\n" % e)
pass
......
# coding: utf-8
"""
RetroShare OpenApi wrapper
RetroShare OpenApi wrapper generated using Doxygen documentation # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.models.req_rs_gxs_channels_get_content_summaries import ReqRsGxsChannelsGetContentSummaries # noqa: E501
from openapi_client.rest import ApiException
from test import API_INSTANCE
class TestReqRsGxsChannelsGetChannelsSummaries(unittest.TestCase):
"""ReqRsGxsChannelsGetChannelsSummaries unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testReqRsGxsChannelsGetChannelsSummaries(self):
api_instance = API_INSTANCE
try:
# Get channels summaries list. Blocking API.
api_response = api_instance.rs_gxs_channels_get_channels_summaries()
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->rs_gxs_channels_get_channels_summaries: %s\n" % e)
pass
if __name__ == '__main__':
unittest.main()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment