Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
shoubhikraj committed Mar 18, 2024
1 parent fb548ab commit 82fba7c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/test_opt/test_opt.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,14 +456,16 @@ def test_optimiser_history_reload():
hist = None
with pytest.raises(FileNotFoundError, match="test.zip does not exist"):
_ = OptimiserHistory.load("test")
with open("test", "w") as fh:
with open("test.zip", "w") as fh:
fh.write("abcd")
# error if file is not zip
with pytest.raises(ValueError, match="not a valid trajectory"):
_ = OptimiserHistory.load("test")
# error if file does not have the autodE opt header
with zipfile.ZipFile("new.zip", "w") as file:
file.write("test")
fh = file.open("testfile", "w")
fh.write("abcd".encode())
fh.close()
with pytest.raises(ValueError, match="not an autodE trajectory"):
_ = OptimiserHistory.load("new.zip")
hist = OptimiserHistory.load("savefile")
Expand Down

0 comments on commit 82fba7c

Please sign in to comment.