Skip to content

Commit 49b80b2

Browse files
committed
move in collection.
1 parent 5393405 commit 49b80b2

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

stac_fastapi/tests/api/test_api.py

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -646,11 +646,11 @@ async def test_patch_operations_collection(app_client, ctx):
646646
operations = [
647647
{"op": "add", "path": "/summaries/hello", "value": "world"},
648648
{"op": "replace", "path": "/summaries/gsd", "value": [50]},
649-
# {
650-
# "op": "move",
651-
# "path": "/summaries/instrument",
652-
# "from": "/summaries/instruments",
653-
# },
649+
{
650+
"op": "move",
651+
"path": "/summaries/instrument",
652+
"from": "/summaries/instruments",
653+
},
654654
# {"op": "copy", "from": "license", "path": "/summaries/license"},
655655
]
656656

@@ -669,12 +669,14 @@ async def test_patch_operations_collection(app_client, ctx):
669669
new_resp_json = new_resp.json()
670670

671671
assert new_resp_json["summaries"]["hello"] == "world"
672-
assert "instruments" not in new_resp_json["summaries"]
673672
assert new_resp_json["summaries"]["gsd"] == [50]
673+
assert "instruments" not in new_resp_json["summaries"]
674+
assert (
675+
new_resp_json["summaries"]["instrument"]
676+
== ctx.collection["summaries"]["instruments"]
677+
)
674678
# assert new_resp_json["license"] == "PDDL-1.0"
675679
# assert new_resp_json["summaries"]["license"] == "PDDL-1.0"
676-
# assert new_resp_json["summaries"]["instrument"] == ["oli", "tirs"]
677-
# assert new_resp_json["summaries"]["platform"] == ["landsat-8"]
678680

679681

680682
@pytest.mark.asyncio
@@ -732,11 +734,11 @@ async def test_patch_operations_item(app_client, ctx):
732734

733735
assert new_resp_json["properties"]["hello"] == "world"
734736
assert "landsat:column" not in new_resp_json["properties"]
735-
assert "instrument" not in new_resp_json["properties"]
736737
assert new_resp_json["properties"]["proj:epsg"] == 1000
737-
assert new_resp_json["properties"]["foo"] == "OLI_TIRS"
738-
assert new_resp_json["properties"]["bar"] == 2500
739-
assert new_resp_json["properties"]["height"] == 2500
738+
assert "instrument" not in new_resp_json["properties"]
739+
assert new_resp_json["properties"]["foo"] == ctx.item["properties"]["instrument"]
740+
assert new_resp_json["properties"]["bar"] == ctx.item["properties"]["height"]
741+
assert new_resp_json["properties"]["height"] == ctx.item["properties"]["height"]
740742

741743

742744
@pytest.mark.asyncio

0 commit comments

Comments
 (0)