Skip to content

Commit

Permalink
pmg test_entrypoint run in tmp_path
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Aug 19, 2023
1 parent dec0193 commit c3e11d6
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,26 @@
from __future__ import annotations

import os
from typing import TYPE_CHECKING

from pymatgen.util.testing import TEST_FILES_DIR

if TYPE_CHECKING:
from pathlib import Path

from pytest import MonkeyPatch


def test_entrypoint(tmp_path: Path, monkeypatch: MonkeyPatch):
monkeypatch.chdir(tmp_path)

def test_entrypoint():
exit_status = os.system(f"pmg analyze {TEST_FILES_DIR}/scan_relaxation")
assert exit_status == 0
assert os.path.exists("vasp_data.gz")
os.remove("vasp_data.gz")

exit_status = os.system(f"pmg structure --convert --filenames {TEST_FILES_DIR}/Li2O.cif POSCAR.Li2O.test")
assert exit_status == 0
assert os.path.exists("POSCAR.Li2O.test")
os.remove("POSCAR.Li2O.test")

exit_status = os.system(f"pmg structure --symmetry 0.1 --filenames {TEST_FILES_DIR}/Li2O.cif")
assert exit_status == 0
Expand Down

0 comments on commit c3e11d6

Please sign in to comment.