-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_currencies_api.py
More file actions
28 lines (20 loc) · 1.01 KB
/
test_currencies_api.py
File metadata and controls
28 lines (20 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import unittest
from fds.analyticsapi.engines.api.currencies_api import CurrenciesApi
from fds.analyticsapi.engines.model.currency import Currency
from common_functions import CommonFunctions
class TestCurrenciesApi(unittest.TestCase):
def setUp(self):
self.currencies_api = CurrenciesApi(CommonFunctions.build_api_client())
def test_get_all_currencies(self):
response = self.currencies_api.get_currencies(
_return_http_data_only=False)
currency_code = list(response[0].data.keys())[0]
self.assertEqual(response[1], 200, "Response should be 200 - Success")
self.assertEqual(type(response[0].data), dict,
"Response should be of Dictionary type.")
self.assertEqual(type(response[0].data[currency_code]),
Currency, "Response should be of Currency type.")
self.assertGreater(
len(response[0].data), 0, "Response result should not be an empty list.")
if __name__ == '__main__':
unittest.main()