def test_deserialize_model_handles_paginated_collection(self): api_client = ApiClient() response = Mock( data=str(self.json_list([self.organization_response()]))) data = api_client.deserialize(response, 'PaginatedCollection') self.assertIsInstance( data, esp_sdk.models.paginated_collection.PaginatedCollection) self.assertIsInstance(data.data[0], esp_sdk.models.organization.Organization)
def test_deserialize_model_handles_esp_objects(self): api_client = ApiClient() response = Mock(data=self.alert_response()) data = api_client.deserialize(response, 'Alert') self.assertIsInstance(data, esp_sdk.models.alert.Alert)
def test_deserialize_model_handles_paginated_collection(self): api_client = ApiClient() response = Mock(data=str(self.json_list([self.organization_response()]))) data = api_client.deserialize(response, 'PaginatedCollection') self.assertIsInstance(data, esp_sdk.models.paginated_collection.PaginatedCollection) self.assertIsInstance(data.data[0], esp_sdk.models.organization.Organization)