Skip to content

Commit

Permalink
Update tests for polygon generation
Browse files Browse the repository at this point in the history
  • Loading branch information
vikineema committed Nov 20, 2023
1 parent afc2e18 commit 1315ade
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tests/test_generate_polygons_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def test_generate_polygons(runner, capsys: pytest.CaptureFixture):
output_directory = TEST_OUTPUT_DIRECTORY
min_polygon_size = 4500
max_polygon_size = math.inf
length_threshold_km = 150
timeseries_directory = TEST_OUTPUT_DIRECTORY
file_name_prefix = "waterbodies"

Expand All @@ -42,21 +43,24 @@ def test_generate_polygons(runner, capsys: pytest.CaptureFixture):
f"--detection-threshold={detection_threshold}",
f"--extent-threshold={extent_threshold}",
f"--min-valid-observations={min_valid_observations}",
# f"--raster-processing-plugin-name={raster_processing_plugin_name}",
f"--min-polygon-size={min_polygon_size}",
f"--max-polygon-size={max_polygon_size}",
f"--output-directory={output_directory}",
f"--length-threshold-km={length_threshold_km}",
"--overwrite",
"--no-split-by-wofs-ls-regions",
f"--timeseries-directory={timeseries_directory}",
f"--file-name-prefix={file_name_prefix}",
f"--output-directory={output_directory}",
]

with capsys.disabled() as disabled: # noqa F841
result = runner.invoke(generate_polygons, args=args, catch_exceptions=True)

assert result.exit_code == 0

test_waterbodies = gpd.read_file(os.path.join(output_directory, "waterbodies.shp"))
test_waterbodies = gpd.read_file(
os.path.join(output_directory, "historical_extent", "waterbodies.shp")
)

assert len(test_waterbodies) == 2

Expand Down

0 comments on commit 1315ade

Please sign in to comment.