Skip to content

Commit

Permalink
Update: tests profile
Browse files Browse the repository at this point in the history
  • Loading branch information
KarineGEO6 committed Jul 15, 2024
1 parent 0b8cba4 commit 24964fd
Show file tree
Hide file tree
Showing 6 changed files with 169 additions and 119 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"id": "v5a9qy1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"unitProfileUnitCategories": [
{
"unit": {
"id": "Meq/100g",
"code": "Meq/100g"
},
"unitCategory": {
"id": "CATION_EXCHANGE_CAPACITY",
"code": "CATION_EXCHANGE_CAPACITY"
}
}
]
}

This file was deleted.

237 changes: 149 additions & 88 deletions tests/test_int_geosys.py

Large diffs are not rendered by default.

25 changes: 0 additions & 25 deletions tests/test_unit_map_product_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,28 +53,3 @@ def test_get_satellite_coverage(self, get_response):
"image.date",
"seasonField.id",
}.issubset(set(info.columns))

@patch("geosyspy.utils.http_client.HttpClient.post")
def test_get_difference_map(self, get_response):
get_response.return_value = mock_http_response_text_content(
"GET",
load_data_from_textfile(
"satellite_coverage_image_references_mock_http_response"
),
)
image_id_earliest = "sentinel-2-l2a%7CS2B_13SGC_20230520_0_L2A"
image_id_latest = "sentinel-2-l2a%7CS2B_13SGC_20230530_0_L2A"
field_id = "bgbrzez"
response = self.service.get_zipped_tiff_difference_map(
field_id, image_id_earliest, image_id_latest
)

assert response.status_code == 200, "Expected status code to be 200"

# Assert that the content type is 'image/tiff'
assert (
response.headers["Content-Type"] == "image/tiff+zip"
), "Expected content type to be 'image/tiff+zip'"

# Assert that the content is not empty
assert response.content, "Expected non-empty response content"
6 changes: 3 additions & 3 deletions tests/test_unit_master_data_management_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ 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"
"master_data_management_get_profile_mock_http_response"
),
status_code=201,
)
Expand All @@ -104,10 +104,10 @@ def test_get_profile_fields(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"
"master_data_management_get_profile_unitProfileUnitCategories_mock_http_response"
),
status_code=201,
)

response = self.service.get_profile(fields="unitProfileUnitCategories")
assert "id" in response
assert "unitProfileUnitCategories" in response

0 comments on commit 24964fd

Please sign in to comment.