Skip to content

Commit

Permalink
Update tests to remove temp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
robbibt authored Nov 19, 2024
1 parent eb1e404 commit 400fb9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Ignore project-specific directories
tests/data/tide_models
tests/data/tide_models_clipped
docs/source

# From https://raw.githubusercontent.com/github/gitignore/main/Python.gitignore
Expand Down
15 changes: 9 additions & 6 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,16 @@ def test_standardise_models(model, ensemble_models, exp_process, exp_request, ex


def test_clip_models():
with tempfile.TemporaryDirectory() as tmpdirname:
clip_models(
input_directory="tests/data/tide_models", output_directory=tmpdirname, bbox=(122.27, -18.07, 122.29, -18.05)
)
out_dir = pathlib.Path("tests/data/tide_models_clipped")

output_files = set([i.stem for i in pathlib.Path(tmpdirname).iterdir()])
assert output_files == set(["GOT5", "EOT20", "hamtide"])
clip_models(
input_directory="tests/data/tide_models",
output_directory=out_dir,
bbox=(122.27, -18.07, 122.29, -18.05),
)

output_files = set([i.stem for i in out_dir.iterdir()])
assert output_files == set(["GOT5", "EOT20", "hamtide"])


@pytest.mark.parametrize(
Expand Down

0 comments on commit 400fb9d

Please sign in to comment.