Skip to content

Commit

Permalink
add test file
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen committed Jun 28, 2023
1 parent 741cdd9 commit 4aca411
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions tests/common/schemas/test_cclib.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,13 @@ def test_cclib_taskdoc(test_dir):
assert "Could not parse" in str(e.value)

# Test a population analysis
doc = TaskDocument.from_logfile(p, ".out", analysis="MBO").dict()
doc = TaskDocument.from_logfile(p, "psi_test.out", analysis="MBO").dict()
assert doc["attributes"]["mbo"] is not None

# Let's try with two analysis (also check case-insensitivity)
doc = TaskDocument.from_logfile(p, ".out", analysis=["mbo", "density"]).dict()
doc = TaskDocument.from_logfile(
p, "psi_test.out", analysis=["mbo", "density"]
).dict()
assert doc["attributes"]["mbo"] is not None
assert doc["attributes"]["density"] is not None

Expand All @@ -75,7 +77,7 @@ def test_cclib_taskdoc(test_dir):
p / "psi_test.cube", "wb"
) as f_out:
shutil.copyfileobj(f_in, f_out)
doc = TaskDocument.from_logfile(p, ".out", analysis=["Bader"]).dict()
doc = TaskDocument.from_logfile(p, "psi_test.out", analysis=["Bader"]).dict()
os.remove(p / "psi_test.cube")
assert doc["attributes"]["bader"] is not None

Expand All @@ -90,7 +92,7 @@ def test_cclib_taskdoc(test_dir):
assert doc.dict()["test"] == "hi"

# Test that the dict printing works
task = TaskDocument.from_logfile(p, ".out")
task = TaskDocument.from_logfile(p, "orca.out")
task.dict()

# test document can be jsanitized
Expand Down
Binary file added tests/test_data/schemas/orca.out.gz
Binary file not shown.

0 comments on commit 4aca411

Please sign in to comment.