Skip to content

Commit

Permalink
Merge pull request #926 from Abhishek-Dimri/fix/path-separator-incons…
Browse files Browse the repository at this point in the history
…istency-crop-raster-tests

Fix path separator inconsistency in crop_raster tests on Windows
  • Loading branch information
ethanwhite authored Feb 17, 2025
2 parents bc7f38e + 3491a1f commit 95c04d5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,9 +211,9 @@ def test_crop_raster_valid_crop(tmpdir):
# Call the function under test
result = utilities.crop_raster(bounds, rgb_path=rgb_path, savedir=tmpdir, filename="crop")

# Assert the output filename
# Assert the output filename (normalize both paths)
expected_filename = str(tmpdir.join("crop.tif"))
assert result == expected_filename
assert os.path.normpath(result) == os.path.normpath(expected_filename)

# Assert the saved crop
with rio.open(result) as src:
Expand Down Expand Up @@ -263,9 +263,9 @@ def test_crop_raster_png_unprojected(tmpdir):
# Call the function under test
result = utilities.crop_raster(bounds, rgb_path=rgb_path, savedir=savedir, filename=filename, driver="PNG")

# Assert the output filename
# Assert the output filename (normalize both paths)
expected_filename = os.path.join(savedir, "crop.png")
assert result == expected_filename
assert os.path.normpath(result) == os.path.normpath(expected_filename)

# Assert the saved crop
with rio.open(result) as src:
Expand Down

0 comments on commit 95c04d5

Please sign in to comment.