@@ -646,11 +646,11 @@ async def test_patch_operations_collection(app_client, ctx):
646
646
operations = [
647
647
{"op" : "add" , "path" : "/summaries/hello" , "value" : "world" },
648
648
{"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
+ },
654
654
# {"op": "copy", "from": "license", "path": "/summaries/license"},
655
655
]
656
656
@@ -669,12 +669,14 @@ async def test_patch_operations_collection(app_client, ctx):
669
669
new_resp_json = new_resp .json ()
670
670
671
671
assert new_resp_json ["summaries" ]["hello" ] == "world"
672
- assert "instruments" not in new_resp_json ["summaries" ]
673
672
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
+ )
674
678
# assert new_resp_json["license"] == "PDDL-1.0"
675
679
# 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"]
678
680
679
681
680
682
@pytest .mark .asyncio
@@ -732,11 +734,11 @@ async def test_patch_operations_item(app_client, ctx):
732
734
733
735
assert new_resp_json ["properties" ]["hello" ] == "world"
734
736
assert "landsat:column" not in new_resp_json ["properties" ]
735
- assert "instrument" not in new_resp_json ["properties" ]
736
737
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" ]
740
742
741
743
742
744
@pytest .mark .asyncio
0 commit comments