Skip to content

Commit

Permalink
pass test
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuan Chiang committed Jan 1, 2024
1 parent c67af75 commit aba55c7
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions tests/command_line/test_chargemol_caller.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,9 @@ def mock_xyz(tmp_path: Path):

def test_parse_chargemol(monkeypatch, mock_xyz):
monkeypatch.setattr(
"pymatgen.command_line.chargemol_caller._download_and_unzip_atomic_densities",
fake_download,
ChargemolAnalysis,
"_download_and_unzip_atomic_densities",
lambda self, version, verbose: fake_download(self),
)

ca = ChargemolAnalysis(path=str(mock_xyz), run_chargemol=False)
Expand Down Expand Up @@ -133,8 +134,13 @@ def test_fake_download_and_modify_path(monkeypatch):

# Create an instance of ChargemolAnalysis
test_dir = f"{TEST_FILES_DIR}/chargemol/spin_unpolarized"
ca = ChargemolAnalysis(path=test_dir, run_chargemol=False)
ca = ChargemolAnalysis(
path=test_dir,
# atomic_densities_path=os.path.expanduser("~/.cache/pymatgen/ddec"),
run_chargemol=False,
)

# Your assertions
assert ca._atomic_densities_path == "~/.cache/pymatgen/ddec"
assert ca._atomic_densities_path == os.getcwd()
# assert ca._atomic_densities_path == os.path.expanduser("~/.cache/pymatgen/ddec")
# TODO: Add more tests to ensure Chargemol was run correctly

0 comments on commit aba55c7

Please sign in to comment.