Commit 6428e15b authored by Joan Pascual Sana's avatar Joan Pascual Sana

Fix some tests

parent 5a5a19bb
......@@ -69,9 +69,9 @@ class TestReqRsGxsChannelsCreatePost(unittest.TestCase):
chanId = None
targetChannelTitle = "Test channel with File Upload"
channels = api_instance.rs_gxs_channels_get_channels_summaries()
for channel in channels["channels"]:
if channel["mGroupName"] in targetChannelTitle:
chanId = channel["mGroupId"]
for channel in channels.channels:
if channel.m_group_name in targetChannelTitle:
chanId = channel.m_group_id
if chanId is None:
raise Exception("Channel not found")
......
......@@ -85,7 +85,7 @@ class TestReqRsGxsChannelsCreatePostV2(unittest.TestCase):
req_rs_gxs_channels_create_post_v2 = {
"channelId": channelId,
"title": "This is the post title modified",
"title": "This is the post title modified2222",
"mBody": "( string)Text content of the post",
# "files": "( list<RsGxsFile>)Optional list of attached files. These are supposed to be already shared,",
"thumbnail": RsGxsImage(m_data=b64imgstr),
......@@ -94,13 +94,13 @@ class TestReqRsGxsChannelsCreatePostV2(unittest.TestCase):
# print(req_rs_gxs_channels_create_post_v2)
# try:
# # Create channel post. Blocking API.
# api_response = api_instance.rs_gxs_channels_create_post_v2(
# req_rs_gxs_channels_create_post_v2=req_rs_gxs_channels_create_post_v2)
# print(api_response)
# except ApiException as e:
# print("Exception when calling DefaultApi->rs_gxs_channels_get_content_summaries: %s\n" % e)
try:
# Create channel post. Blocking API.
api_response = api_instance.rs_gxs_channels_create_post_v2(
req_rs_gxs_channels_create_post_v2=req_rs_gxs_channels_create_post_v2)
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->rs_gxs_channels_get_content_summaries: %s\n" % e)
pass
......
......@@ -64,17 +64,16 @@ class TestReqRsIdentityUpdateIdentity(unittest.TestCase):
print("Exception when calling DefaultApi->rs_identity_get_identities_info: %s\n" % e)
# Now lets get the RsGxsIdGroup object from the array of returned ids
for id in api_response['idsInfo']:
if id['mMeta']['mGroupId'] == reqId:
for id in api_response.ids_info:
if id.m_meta.m_group_id == reqId:
reqId = id
# Now modify the desired components
print(reqId)
reqId['mMeta']['mGroupName'] = 'AnonymousIdTest2'
reqId.m_meta.m_group_name = 'AnonymousIdTest2'
# This won't work because the API return the info on camelCase and the object attrs are stored in snake_case
# Todo: modify the openapi generator python template to be camelCase only (to unify with RS project)
# Todo: support to return objects using [out] params on the template generation
# rsGxsIdGroup = RsGxsIdGroup(reqId)
# rsGroupMetaData = RsGroupMetaData(rsGxsIdGroup.m_meta)
......
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