-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathtest_columns_api.py
More file actions
37 lines (28 loc) · 1.46 KB
/
test_columns_api.py
File metadata and controls
37 lines (28 loc) · 1.46 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
import unittest
from fds.analyticsapi.engines.api.columns_api import ColumnsApi
from fds.analyticsapi.engines.model.column import Column
from fds.analyticsapi.engines.model.column_summary import ColumnSummary
from common_functions import CommonFunctions
class TestColumnsApi(unittest.TestCase):
def setUp(self):
self.columns_api = ColumnsApi(CommonFunctions.build_api_client())
def test_get_all_pa_columns(self):
response = self.columns_api.get_pa_columns(
_return_http_data_only=False)
self.assertEqual(response[1], 200,
"Response code should be 200 - Success")
self.assertEqual(
type(response[0]['data']), dict, "Response should be of Dictionary type")
self.assertEqual(type(response[0]['data'][list(response[0]['data'].keys())[
0]]), ColumnSummary, "Response should be of ColumnSummary type")
def test_get_pa_column_details_by_id(self):
columns = self.columns_api.get_pa_columns(_return_http_data_only=True)
column_id = list(columns.data.keys())[0]
response = self.columns_api.get_pa_column_by_id(
column_id, _return_http_data_only=False)
self.assertEqual(response[1], 200,
"Response code should be 200 - Success")
self.assertEqual(type(response[0]['data']),
Column, "Response should be of Column type")
if __name__ == '__main__':
unittest.main()