Skip to content

Commit afcca63

Browse files
committed
Fix UT
1 parent 5bb1375 commit afcca63

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

services/catalog/tests/test_authentication_catalog.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,7 +1304,7 @@ async def test_http200_with_good_authentication(
13041304
)
13051305
assert response.status_code == HTTP_200_OK
13061306
content = json.loads(response.content)
1307-
assert content["context"] == {"limit": 10, "returned": 1}
1307+
assert content["numberReturned"] == 1
13081308

13091309
response = client.request(
13101310
"GET",
@@ -1314,7 +1314,7 @@ async def test_http200_with_good_authentication(
13141314
)
13151315
assert response.status_code == HTTP_200_OK
13161316
content = json.loads(response.content)
1317-
assert content["context"] == {"limit": 10, "returned": 2}
1317+
assert content["numberReturned"] == 2
13181318

13191319
response = client.request(
13201320
"POST",
@@ -1324,7 +1324,7 @@ async def test_http200_with_good_authentication(
13241324
)
13251325
assert response.status_code == HTTP_200_OK
13261326
content = json.loads(response.content)
1327-
assert content["context"] == {"limit": 10, "returned": 2}
1327+
assert content["numberReturned"] == 2
13281328

13291329
@pytest.mark.parametrize("test_apikey, test_oauth2", [[True, False], [False, True]], ids=["apikey", "oauth2"])
13301330
async def test_fails_without_good_perms(self, mocker, httpx_mock: HTTPXMock, client, test_apikey, test_oauth2):

services/catalog/tests/test_endpoints.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ def test_delete_non_empty_collection(self, client, a_minimal_collection, a_corre
698698
"""
699699
first_get_collection_response = client.get("/catalog/collections/fixture_owner:fixture_collection/items")
700700
assert first_get_collection_response.status_code == fastapi.status.HTTP_200_OK
701-
assert json.loads(first_get_collection_response.content)["context"]["returned"] == 0
701+
assert json.loads(first_get_collection_response.content)["numberReturned"] == 0
702702
# Post the feature to the collection
703703
updated_feature_sent = copy.deepcopy(a_correct_feature)
704704
updated_feature_sent["collection"] = "fixture_collection"
@@ -710,7 +710,7 @@ def test_delete_non_empty_collection(self, client, a_minimal_collection, a_corre
710710
# Test that the collection is not empty
711711
second_get_collection_response = client.get("/catalog/collections/fixture_owner:fixture_collection/items")
712712
assert second_get_collection_response.status_code == fastapi.status.HTTP_200_OK
713-
assert json.loads(second_get_collection_response.content)["context"]["returned"] > 0
713+
assert json.loads(second_get_collection_response.content)["numberReturned"] > 0
714714
# Delete the collection
715715
delete_response = client.delete("/catalog/collections/fixture_owner:fixture_collection")
716716
assert delete_response.status_code == fastapi.status.HTTP_200_OK
@@ -1480,7 +1480,7 @@ def test_create_new_minimal_feature(self, client, a_minimal_collection, a_correc
14801480
assert check_features_response.status_code == fastapi.status.HTTP_200_OK
14811481
# Test if query returns only one feature for this collection
14821482
returned_features = json.loads(check_features_response.content)
1483-
assert returned_features["context"]["returned"] == 1
1483+
assert returned_features["numberReturned"] == 1
14841484
# Test feature content
14851485
assert returned_features["features"][0]["id"] == a_correct_feature["id"]
14861486
assert returned_features["features"][0]["geometry"] == a_correct_feature["geometry"]
@@ -1696,7 +1696,7 @@ def test_delete_a_correct_feature(self, client, a_minimal_collection, a_correct_
16961696
collection_content_response = client.get("/catalog/collections/fixture_owner:fixture_collection/items")
16971697
assert collection_content_response.status_code == fastapi.status.HTTP_200_OK
16981698
collection_content_response = json.loads(collection_content_response.content)
1699-
assert collection_content_response["context"]["returned"] == 0
1699+
assert collection_content_response["numberReturned"] == 0
17001700
assert (
17011701
client.delete("/catalog/collections/fixture_owner:fixture_collection").status_code
17021702
== fastapi.status.HTTP_200_OK

0 commit comments

Comments
 (0)