def test_scenes_bands_dict(self): meta_bands = { "someproduct:red": { "name": "red", "id": "someproduct:red" }, "someproduct:green": { "name": "green", "id": "someproduct:green" }, "someproduct:ndvi": { "name": "ndvi", "id": "someproduct:ndvi" }, "derived:ndvi": { "name": "ndvi", "id": "derived:ndvi" }, } scenes_bands = Scene._scenes_bands_dict(meta_bands) self.assertEqual( set(scenes_bands.keys()), {"red", "green", "ndvi", "derived:ndvi"} ) self.assertEqual(scenes_bands.ndvi, meta_bands["someproduct:ndvi"]) self.assertEqual(scenes_bands["derived:ndvi"], meta_bands["derived:ndvi"])
def test_scenes_bands_dict(self): meta_bands = { "someproduct:red": { "name": "red", "id": "someproduct:red" }, "someproduct:green": { "name": "green", "id": "someproduct:green" }, "someproduct:ndvi": { "name": "ndvi", "id": "someproduct:ndvi" }, "derived:ndvi": { "name": "ndvi", "id": "derived:ndvi" }, } scenes_bands = Scene._scenes_bands_dict(meta_bands) assert set( scenes_bands.keys()) == {"red", "green", "ndvi", "derived:ndvi"} assert scenes_bands.ndvi == meta_bands["someproduct:ndvi"] assert scenes_bands["derived:ndvi"] == meta_bands["derived:ndvi"]