def test_collection_of_collection(): space = pystac.SpatialExtent([[0, 1, 2, 3]]) time = pystac.TemporalExtent([datetime.datetime(2000, 1, 1), datetime.datetime(2000, 1, 1)]) child = pystac.Collection('child', 'child-description', extent=pystac.Extent(space, time)) parent = pystac.Collection('parent', 'parent-description', extent=pystac.Extent(space, time),) parent.add_child(child) result = StacCollection(parent) result._load()
def test_cat_from_collection(pystac_col): cat = StacCollection(pystac_col) subcat_name = 'sentinel-2a-catalog' item_name = 'S2B_25WFU_20200610_0_L1C' assert cat.name == pystac_col.id assert subcat_name in cat assert item_name in cat[subcat_name] assert 'B04' in cat[subcat_name][item_name]
def test_init_catalog_with_wrong_type_raises(stac_cat_obj): with pytest.raises(ValueError): StacCollection(stac_cat_obj)
def test_cat_from_collection(stac_collection_obj): cat = StacCollection(stac_collection_obj) assert 'S2B_25WFU_20200610_0_L1C' in cat assert 'B05' in cat.S2B_25WFU_20200610_0_L1C
def test_cat_from_collection(stac_collection_obj): cat = StacCollection(stac_collection_obj) assert "L1C_T53MNQ_A017245_20181011T011722" in cat assert "B05" in cat.L1C_T53MNQ_A017245_20181011T011722