Skip to content

Commit 24964fd

Browse files
committed
Update: tests profile
1 parent 0b8cba4 commit 24964fd

6 files changed

+169
-119
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"id": "v5a9qy1"
3+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"unitProfileUnitCategories": [
3+
{
4+
"unit": {
5+
"id": "Meq/100g",
6+
"code": "Meq/100g"
7+
},
8+
"unitCategory": {
9+
"id": "CATION_EXCHANGE_CAPACITY",
10+
"code": "CATION_EXCHANGE_CAPACITY"
11+
}
12+
}
13+
]
14+
}

tests/resources/master_data_management_post_profile_mock_http_response

Lines changed: 0 additions & 3 deletions
This file was deleted.

tests/test_int_geosys.py

Lines changed: 149 additions & 88 deletions
Large diffs are not rendered by default.

tests/test_unit_map_product_service.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,3 @@ def test_get_satellite_coverage(self, get_response):
5353
"image.date",
5454
"seasonField.id",
5555
}.issubset(set(info.columns))
56-
57-
@patch("geosyspy.utils.http_client.HttpClient.post")
58-
def test_get_difference_map(self, get_response):
59-
get_response.return_value = mock_http_response_text_content(
60-
"GET",
61-
load_data_from_textfile(
62-
"satellite_coverage_image_references_mock_http_response"
63-
),
64-
)
65-
image_id_earliest = "sentinel-2-l2a%7CS2B_13SGC_20230520_0_L2A"
66-
image_id_latest = "sentinel-2-l2a%7CS2B_13SGC_20230530_0_L2A"
67-
field_id = "bgbrzez"
68-
response = self.service.get_zipped_tiff_difference_map(
69-
field_id, image_id_earliest, image_id_latest
70-
)
71-
72-
assert response.status_code == 200, "Expected status code to be 200"
73-
74-
# Assert that the content type is 'image/tiff'
75-
assert (
76-
response.headers["Content-Type"] == "image/tiff+zip"
77-
), "Expected content type to be 'image/tiff+zip'"
78-
79-
# Assert that the content is not empty
80-
assert response.content, "Expected non-empty response content"

tests/test_unit_master_data_management_service.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ def test_get_profile(self, get_response):
9191
get_response.return_value = mock_http_response_text_content(
9292
"GET",
9393
load_data_from_textfile(
94-
"master_data_management_post_profile_mock_http_response"
94+
"master_data_management_get_profile_mock_http_response"
9595
),
9696
status_code=201,
9797
)
@@ -104,10 +104,10 @@ def test_get_profile_fields(self, get_response):
104104
get_response.return_value = mock_http_response_text_content(
105105
"GET",
106106
load_data_from_textfile(
107-
"master_data_management_post_profile_mock_http_response"
107+
"master_data_management_get_profile_unitProfileUnitCategories_mock_http_response"
108108
),
109109
status_code=201,
110110
)
111111

112112
response = self.service.get_profile(fields="unitProfileUnitCategories")
113-
assert "id" in response
113+
assert "unitProfileUnitCategories" in response

0 commit comments

Comments
 (0)