@@ -786,44 +786,51 @@ def filter_bbox(self, bbox):
786
786
assert new .bbox == (1 , 2 , 3 , 4 )
787
787
788
788
789
- collection_json = {
790
- "type" : "Collection" ,
791
- "id" : "test-collection" ,
792
- "stac_version" : "1.0.0" ,
793
- "description" : "Test collection" ,
794
- "links" : [],
795
- "title" : "Test Collection" ,
796
- "extent" : {
797
- "spatial" : {"bbox" : [[- 180.0 , - 90.0 , 180.0 , 90.0 ]]},
798
- "temporal" : {"interval" : [["2020-01-01T00:00:00Z" , "2020-01-10T00:00:00Z" ]]},
799
- },
800
- "license" : "proprietary" ,
801
- "summaries" : {"eo:bands" : [{"name" : "B01" }, {"name" : "B02" }]},
802
- }
803
-
804
- catalog_json = {
805
- "type" : "Catalog" ,
806
- "id" : "test-catalog" ,
807
- "stac_version" : "1.0.0" ,
808
- "description" : "Test Catalog" ,
809
- "links" : [],
810
- }
811
-
812
- item_json = {
813
- "type" : "Feature" ,
814
- "stac_version" : "1.0.0" ,
815
- "id" : "test-item" ,
816
- "properties" : {"datetime" : "2020-05-22T00:00:00Z" , "eo:bands" : [{"name" : "SCL" }, {"name" : "B08" }]},
817
- "geometry" : {"coordinates" : [[[0 , 0 ], [0 , 1 ], [1 , 1 ], [1 , 0 ], [0 , 0 ]]], "type" : "Polygon" },
818
- "links" : [],
819
- "assets" : {},
820
- "bbox" : [0 , 1 , 0 , 1 ],
821
- "stac_extensions" : [],
822
- }
823
-
824
-
825
789
@pytest .mark .parametrize (
826
- "test_stac, expected" , [(collection_json , ["B01" , "B02" ]), (catalog_json , []), (item_json , ["SCL" , "B08" ])]
790
+ "test_stac, expected" ,
791
+ [
792
+ (
793
+ {
794
+ "type" : "Collection" ,
795
+ "id" : "test-collection" ,
796
+ "stac_version" : "1.0.0" ,
797
+ "description" : "Test collection" ,
798
+ "links" : [],
799
+ "title" : "Test Collection" ,
800
+ "extent" : {
801
+ "spatial" : {"bbox" : [[- 180.0 , - 90.0 , 180.0 , 90.0 ]]},
802
+ "temporal" : {"interval" : [["2020-01-01T00:00:00Z" , "2020-01-10T00:00:00Z" ]]},
803
+ },
804
+ "license" : "proprietary" ,
805
+ "summaries" : {"eo:bands" : [{"name" : "B01" }, {"name" : "B02" }]},
806
+ },
807
+ ["B01" , "B02" ],
808
+ ),
809
+ (
810
+ {
811
+ "type" : "Catalog" ,
812
+ "id" : "test-catalog" ,
813
+ "stac_version" : "1.0.0" ,
814
+ "description" : "Test Catalog" ,
815
+ "links" : [],
816
+ },
817
+ [],
818
+ ),
819
+ (
820
+ {
821
+ "type" : "Feature" ,
822
+ "stac_version" : "1.0.0" ,
823
+ "id" : "test-item" ,
824
+ "properties" : {"datetime" : "2020-05-22T00:00:00Z" , "eo:bands" : [{"name" : "SCL" }, {"name" : "B08" }]},
825
+ "geometry" : {"coordinates" : [[[0 , 0 ], [0 , 1 ], [1 , 1 ], [1 , 0 ], [0 , 0 ]]], "type" : "Polygon" },
826
+ "links" : [],
827
+ "assets" : {},
828
+ "bbox" : [0 , 1 , 0 , 1 ],
829
+ "stac_extensions" : [],
830
+ },
831
+ ["SCL" , "B08" ],
832
+ ),
833
+ ],
827
834
)
828
835
def test_metadata_from_stac (tmp_path , test_stac , expected ):
829
836
0 commit comments