Skip to content

Commit

Permalink
test_get_model_weights mac os fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Gwenneth Straub committed Jul 29, 2024
1 parent c03e45e commit c2bc971
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tests/unit_tests/test_unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,13 +263,14 @@ def test_get_model_weights(monkeypatch):
mnk.setattr(github, "Github", mock_github)
mnk.setattr(requests, "get", mock_get)

filename = os.path.join(tmp_dir, "casanovo_massivekb_v3_0_0.ckpt")
assert not os.path.isfile(filename)
result_path = casanovo._get_model_weights(pathlib.Path(tmp_dir))
assert str(result_path.resolve()) == filename
assert os.path.isfile(filename)
result_path = casanovo._get_model_weights(pathlib.Path(tmp_dir))
assert str(result_path.resolve()) == filename
tmp_path = pathlib.Path(tmp_dir)
filename = tmp_path / "casanovo_massivekb_v3_0_0.ckpt"
assert not filename.is_file()
result_path = casanovo._get_model_weights(tmp_path)
assert result_path == filename
assert filename.is_file()
result_path = casanovo._get_model_weights(tmp_path)
assert result_path == filename

# Impossible to find model weights for (i) full version mismatch and (ii)
# major version mismatch.
Expand Down

0 comments on commit c2bc971

Please sign in to comment.