def test_list_to_obj(self): """ test to verify Endpoints.list_to_obj() can convert a list representation of Endpoints to an Endpoints object """ # ARRANGE endpoints_list = ['test_endpoint_1', 'test_endpoint_2', 'test_endpoint_3'] expected_endpoints_obj = Endpoints(endpoints=['mocked stuff', 'mocked stuff', 'mocked stuff']) # ACT endpoints_resp_obj = Endpoints._list_to_obj(endpoints_list) # ASSERT self.assertEqual(expected_endpoints_obj, endpoints_resp_obj)
def test_json_to_obj(self): """ test to verify Endpoints.list_to_obj() can convert a list representation of Endpoints to an Endpoints object """ # ARRANGE endpoints_list = ['test_endpoint_1', 'test_endpoint_2', 'test_endpoint_3'] endpoints_dict = { self.ROOT_TAG: endpoints_list} endpoints_json = json.dumps(endpoints_dict) expected_endpoints_obj = Endpoints(endpoints=['mocked stuff', 'mocked stuff', 'mocked stuff']) # ACT endpoints_resp_obj = Endpoints._json_to_obj(endpoints_json) # ASSERT self.assertEqual(expected_endpoints_obj, endpoints_resp_obj)