Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_footprints_s2(products, fixture_path):
footprints = SentinelAPI.to_geojson(products)
for footprint in footprints["features"]:
assert not footprint["geometry"].errors()
with open(fixture_path("expected_search_footprints_s2.geojson")) as geojson_file:
expected_footprints = geojson.loads(geojson_file.read())
# to compare unordered lists (JSON objects) they need to be sorted or changed to sets
assert set(footprints) == set(expected_footprints)
def test_footprints_s2(products, fixture_path):
footprints = SentinelAPI.to_geojson(products)
for footprint in footprints['features']:
assert not footprint['geometry'].errors()
with open(fixture_path('expected_search_footprints_s2.geojson')) as geojson_file:
expected_footprints = geojson.loads(geojson_file.read())
# to compare unordered lists (JSON objects) they need to be sorted or changed to sets
assert set(footprints) == set(expected_footprints)