-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_frequencies_api.py
More file actions
56 lines (46 loc) · 2.43 KB
/
test_frequencies_api.py
File metadata and controls
56 lines (46 loc) · 2.43 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import unittest
from fds.analyticsapi.engines.api.frequencies_api import FrequenciesApi
from fds.analyticsapi.engines.model.frequency import Frequency
from common_functions import CommonFunctions
class TestFrequenciesApi(unittest.TestCase):
def setUp(self):
self.frequencies_api = FrequenciesApi(
CommonFunctions.build_api_client())
def test_get_pa_frequencies(self):
response = self.frequencies_api.get_pa_frequencies(
_return_http_data_only=False)
self.assertEqual(response[1], 200, "Response should be 200 - Success")
self.assertEqual(type(response[0].data), dict,
"Response should be of dictionary type.")
frequencies = list(response[0].data.keys())
first_key = frequencies[0]
self.assertEqual(type(response[0].data[first_key]),
Frequency, "Response should be of Frequency type.")
self.assertGreater(len(frequencies), 0,
"Response result should not be an empty list.")
def test_get_spar_frequencies(self):
response = self.frequencies_api.get_spar_frequencies(
_return_http_data_only=False)
self.assertEqual(response[1], 200, "Response should be 200 - Success")
self.assertEqual(type(response[0].data), dict,
"Response should be of dictionary type.")
frequencies = list(response[0].data.keys())
first_key = frequencies[0]
self.assertEqual(type(response[0].data[first_key]),
Frequency, "Response should be of Frequency type.")
self.assertGreater(len(frequencies), 0,
"Response result should not be an empty list.")
def test_get_vault_frequencies(self):
response = self.frequencies_api.get_vault_frequencies(
_return_http_data_only=False)
self.assertEqual(response[1], 200, "Response should be 200 - Success")
self.assertEqual(type(response[0].data), dict,
"Response should be of dictionary type.")
frequencies = list(response[0].data.keys())
first_key = frequencies[0]
self.assertEqual(type(response[0].data[first_key]),
Frequency, "Response should be of Frequency type.")
self.assertGreater(len(frequencies), 0,
"Response result should not be an empty list.")
if __name__ == '__main__':
unittest.main()