Commit 5a5a19bb authored by Joan Pascual Sana's avatar Joan Pascual Sana

Write tests: map<> pair<>

parent 154e9420
# 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_files_file_download_chunks_details import ReqRsFilesFileDownloadChunksDetails # noqa: E501
from openapi_client.rest import ApiException
from own_test import API_INSTANCE
class TestReqRsFilesFileDownloadChunksDetails(unittest.TestCase):
"""ReqRsFilesFileDownloadChunksDetails unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testReqRsFilesFileDownloadChunksDetails(self):
"""Test ReqRsFilesFileDownloadChunksDetails"""
api_instance = API_INSTANCE
# Use this to get the hash of the file that you want
# res = api_instance.rs_files_file_downloads()
# print(res)
# Now lets get information
req_rs_files_file_download_chunks_details = {
"hash": "20d3c155331817a6b10743b6ab5f613d7fdabc6b"} # ReqRsFilesFileDownloadChunksDetails | hash: \"( RsFileHash)file identifier \" (optional)
try:
# Get chunk details about the downloaded file with given hash.
api_response = api_instance.rs_files_file_download_chunks_details(
req_rs_files_file_download_chunks_details=req_rs_files_file_download_chunks_details)
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->rs_files_file_download_chunks_details: %s\n" % e)
pass
if __name__ == '__main__':
unittest.main()
# 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.resp_rs_config_get_all_bandwidth_rates import RespRsConfigGetAllBandwidthRates # noqa: E501
from openapi_client.rest import ApiException
from own_test import API_INSTANCE
class TestRespRsConfigGetAllBandwidthRates(unittest.TestCase):
"""RespRsConfigGetAllBandwidthRates unit test stubs"""
def setUp(self):
pass
def tearDown(self):
pass
def testRespRsConfigGetAllBandwidthRates(self):
"""Test RespRsConfigGetAllBandwidthRates"""
# Create an instance of the API class
api_instance = API_INSTANCE
try:
# getAllBandwidthRates get the bandwidth rates for all peers
api_response = api_instance.rs_config_get_all_bandwidth_rates()
print(api_response)
except ApiException as e:
print("Exception when calling DefaultApi->rs_config_get_all_bandwidth_rates: %s\n" % e)
pass
if __name__ == '__main__':
unittest.main()
......@@ -31,6 +31,13 @@ Here some test examples to follow:
* [Modify a post and add a thumbnail](own_test/test_req_rs_gxs_channels_create_post_v2.py).
Here we can see the process to add a base64 image.
#### Testing return types
This tests are used to test that the return types values are correct:
* [Test map<key, value>](own_test/test_resp_rs_config_get_all_bandwidth_rates.py)
* [Test pair<first, second>](own_test/test_req_rs_files_file_download_chunks_details.py)
## File uploads
For file uploads you have two ways:
......
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