From 9353f31590a1df64626e6548f2c7c93177d6534f Mon Sep 17 00:00:00 2001 From: kls Date: Wed, 26 Jun 2024 14:55:27 -0500 Subject: [PATCH] Update: unit test master_data_management --- ...ata_management_post_profile_mock_http_response | 3 +++ tests/test_unit_master_data_management_service.py | 15 +++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 tests/resources/master_data_management_post_profile_mock_http_response diff --git a/tests/resources/master_data_management_post_profile_mock_http_response b/tests/resources/master_data_management_post_profile_mock_http_response new file mode 100644 index 0000000..be897c9 --- /dev/null +++ b/tests/resources/master_data_management_post_profile_mock_http_response @@ -0,0 +1,3 @@ +{ + "id":"ajqxm3v" +} \ No newline at end of file diff --git a/tests/test_unit_master_data_management_service.py b/tests/test_unit_master_data_management_service.py index 1fe9b63..f0da6a0 100644 --- a/tests/test_unit_master_data_management_service.py +++ b/tests/test_unit_master_data_management_service.py @@ -57,3 +57,18 @@ def test_get_season_fields(self, get_response): response = self.service.get_season_fields(sfids) assert len(response) == 20 + @patch('geosyspy.utils.http_client.HttpClient.get') + def test_get_profile(self, get_response): + get_response.return_value = mock_http_response_text_content('GET', load_data_from_textfile( + "master_data_management_post_profile_mock_http_response"), status_code=201) + + response = self.service.get_profile() + assert response.status_code == 200 + + @patch('geosyspy.utils.http_client.HttpClient.get') + def test_get_profile(self, get_response): + get_response.return_value = mock_http_response_text_content('GET', load_data_from_textfile( + "master_data_management_post_profile_mock_http_response"), status_code=201) + + response = self.service.get_profile("") + assert response.status_code == 200