Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions autotest/test_get_modflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,20 @@ def test_run_main_any_repo(tmp_path, monkeypatch):
run_main(tmp_path, owner="me", repo="my-build", ostag="linux", quiet=True)


@pytest.mark.parametrize("asset", ["macarm.zip", "mf6.8.2_macarm.zip"])
def test_run_main_ostag_matches_asset_exactly(tmp_path, monkeypatch, asset):
# an asset whose name only contains the ostag is not selected
release = {
"tag_name": "v1",
"assets": [{"name": asset}],
"html_url": "https://example.com",
}
monkeypatch.setattr(get_modflow, "get_release", lambda *args, **kwargs: release)

with pytest.raises(ValueError, match="could not find ostag"):
run_main(tmp_path, owner="me", repo="my-build", ostag="mac", quiet=True)


@flaky
@requires_github
@pytest.mark.parametrize("repo", repo_options.keys())
Expand Down
2 changes: 1 addition & 1 deletion flopy/utils/get_modflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ def run_main(
assets = release.get("assets", [])
for asset in assets:
asset_name = asset["name"]
if ostag in asset_name:
if asset_name == f"{ostag}.zip" or asset_name.endswith(f"_{ostag}.zip"):
break
else:
raise ValueError(
Expand Down
Loading