Skip to content

Commit

Permalink
Add a small test (#2133)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew-S-Rosen committed May 12, 2024
1 parent 1424e3f commit 8f9d07a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/quacc/calculators/vasp/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,11 +398,11 @@ def __init__(
-------
None
"""
if atoms is None and prev_dir is None:
raise ValueError("Either atoms or prev_dir must be provided.")
self.atoms = atoms
self.prev_dir = prev_dir
self.structure = AseAtomsAdaptor.get_structure(atoms)
if atoms is None and prev_dir is None:
raise ValueError("Either atoms or prev_dir must be provided.")

def convert_dict_set(self, dict_set: DictSet) -> dict:
"""
Expand Down
5 changes: 5 additions & 0 deletions tests/core/calculators/vasp/test_vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,11 @@ def test_preset_override():
assert calc.parameters.get("efermi") is None


def test_bad_pmg_converter():
with pytest.raises(ValueError, match="Either atoms or prev_dir must be provided"):
MPtoASEConverter()


def test_pmg_input_set():
atoms = bulk("Cu")
parameters = MPtoASEConverter(atoms=atoms).convert_dict_set(MPRelaxSet)
Expand Down

0 comments on commit 8f9d07a

Please sign in to comment.