Commit ed3e3393 authored by Joan Pascual Sana's avatar Joan Pascual Sana

Write some tests, login and channels info, creation, summaries

parent af179fb7
......@@ -22,4 +22,5 @@
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
.gitignore
\ No newline at end of file
.gitignore
test/__init__.py
\ No newline at end of file
import openapi_client
configuration = openapi_client.Configuration()
# Configure HTTP basic authorization: BasicAuth
configuration.username = 'test'
configuration.password = 'test'
# Create an instance of the API class
API_INSTANCE = openapi_client.DefaultApi(openapi_client.ApiClient(configuration))
\ No newline at end of file
......@@ -17,7 +17,9 @@ import unittest
import openapi_client
from openapi_client.models.req_rs_gxs_channels_create_channel import ReqRsGxsChannelsCreateChannel # noqa: E501
from openapi_client.rest import ApiException
from test import API_INSTANCE
from openapi_client.models.rs_gxs_channel_group import RsGxsChannelGroup
from openapi_client.models.rs_group_meta_data import RsGroupMetaData
class TestReqRsGxsChannelsCreateChannel(unittest.TestCase):
"""ReqRsGxsChannelsCreateChannel unit test stubs"""
......@@ -31,7 +33,23 @@ class TestReqRsGxsChannelsCreateChannel(unittest.TestCase):
def testReqRsGxsChannelsCreateChannel(self):
"""Test ReqRsGxsChannelsCreateChannel"""
# FIXME: construct object with mandatory attributes with example values
# model = openapi_client.models.req_rs_gxs_channels_create_channel.ReqRsGxsChannelsCreateChannel() # noqa: E501
api_instance = API_INSTANCE
groupMetada = RsGroupMetaData(m_group_name="Just another test channel2", m_group_flags=4, m_sign_flags=520)
channel = RsGxsChannelGroup(m_meta=groupMetada, m_description="Test it!")
# req_rs_gxs_channels_create_channel = {
# "channel": channel} # ReqRsGxsChannelsCreateChannel | channel: ( RsGxsChannelGroup)Channel data (name, description...) (optional)
model = openapi_client.models.req_rs_gxs_channels_create_channel.ReqRsGxsChannelsCreateChannel(channel= channel) # noqa: E501
try:
# Deprecated{ substituted by createChannelV2 }
api_response = api_instance.rs_gxs_channels_create_channel(
req_rs_gxs_channels_create_channel=model)
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->rs_gxs_channels_create_channel: %s\n" % e)
pass
......
......@@ -17,7 +17,8 @@ import unittest
import openapi_client
from openapi_client.models.req_rs_gxs_channels_get_channels_info import ReqRsGxsChannelsGetChannelsInfo # noqa: E501
from openapi_client.rest import ApiException
from openapi_client.models.req_rs_gxs_channels_get_channels_info import ReqRsGxsChannelsGetChannelsInfo
from test import API_INSTANCE
class TestReqRsGxsChannelsGetChannelsInfo(unittest.TestCase):
"""ReqRsGxsChannelsGetChannelsInfo unit test stubs"""
......@@ -32,6 +33,23 @@ class TestReqRsGxsChannelsGetChannelsInfo(unittest.TestCase):
"""Test ReqRsGxsChannelsGetChannelsInfo"""
# FIXME: construct object with mandatory attributes with example values
# model = openapi_client.models.req_rs_gxs_channels_get_channels_info.ReqRsGxsChannelsGetChannelsInfo() # noqa: E501
api_instance = API_INSTANCE
chanIds = ["20fee40b844cf68caaf87f5db23c8112"]
# req_rs_gxs_channels_get_channels_info = {
# "chanIds": channelsList } # ReqRsGxsChannelsGetChannelsInfo | chanIds: ( list<RsGxsGroupId>)ids of the channels of which to get the informations (optional)
chanIds = "20fee40b844cf68caaf87f5db23c8112"
req_rs_gxs_channels_get_channels_info = ReqRsGxsChannelsGetChannelsInfo(chan_ids = [chanIds])
try:
# Get channels information (description, thumbnail...). Blocking API.
api_response = api_instance.rs_gxs_channels_get_channels_info(
req_rs_gxs_channels_get_channels_info=req_rs_gxs_channels_get_channels_info)
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->rs_gxs_channels_get_channels_info: %s\n" % e)
pass
......
......@@ -17,6 +17,7 @@ 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 TestReqRsGxsChannelsGetContentSummaries(unittest.TestCase):
......@@ -29,9 +30,15 @@ class TestReqRsGxsChannelsGetContentSummaries(unittest.TestCase):
pass
def testReqRsGxsChannelsGetContentSummaries(self):
"""Test ReqRsGxsChannelsGetContentSummaries"""
# FIXME: construct object with mandatory attributes with example values
# model = openapi_client.models.req_rs_gxs_channels_get_content_summaries.ReqRsGxsChannelsGetContentSummaries() # noqa: E501
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
......
......@@ -17,6 +17,7 @@ import unittest
import openapi_client
from openapi_client.models.rs_login_helper_location import RsLoginHelperLocation # noqa: E501
from openapi_client.rest import ApiException
from openapi_client.models import req_rs_login_helper_attempt_login as request
class TestRsLoginHelperLocation(unittest.TestCase):
......@@ -30,7 +31,25 @@ class TestRsLoginHelperLocation(unittest.TestCase):
def testRsLoginHelperLocation(self):
"""Test RsLoginHelperLocation"""
# FIXME: construct object with mandatory attributes with example values
configuration = openapi_client.Configuration()
# Configure HTTP basic authorization: BasicAuth
configuration.username = '814228577bc0c5da968c79272adcbfce'
configuration.password = 'prueba'
# Create an instance of the API class
api_instance = openapi_client.DefaultApi(openapi_client.ApiClient(configuration))
# req_rs_login_helper_attempt_login = {"account": configuration.username,
# "password": configuration.password} # ReqRsLoginHelperAttemptLogin | account: ( RsPeerId)Id of the account to which attempt login password: ( string)Password for the given account (optional)
req_rs_login_helper_attempt_login = request.ReqRsLoginHelperAttemptLogin(
account = configuration.username, password=configuration.password)
try:
# Normal way to attempt login
api_response = api_instance.rs_login_helper_attempt_login(
req_rs_login_helper_attempt_login=req_rs_login_helper_attempt_login)
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->rs_login_helper_attempt_login: %s\n" % e)
# model = openapi_client.models.rs_login_helper_location.RsLoginHelperLocation() # noqa: E501
pass
......
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