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_raises_error_if_targets_empty(self):
square1 = square_at((0, 0))
square2 = square_at((1, 0))
sources = geopandas.GeoSeries([square1, square2])
targets = geopandas.GeoSeries()
with pytest.raises(IndexError):
absorb_by_shared_perimeter(sources, targets)
def test_returns_targets_if_sources_empty(self):
square1 = square_at((0, 0))
square2 = square_at((1, 0))
targets = geopandas.GeoSeries([square1, square2])
sources = geopandas.GeoSeries()
assert absorb_by_shared_perimeter(sources, targets) is targets