Skip to content

Commit 0abf835

Browse files
expand out force constants test
1 parent d9dce23 commit 0abf835

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

tests/materials/test_phonon.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,21 @@ def test_phonon_get_methods(use_document_model):
4242
for func_name, schema in {
4343
"bandstructure": PhononBS,
4444
"dos": PhononDOS,
45-
# "forceconstants": list
45+
"forceconstants": list,
4646
}.items():
47+
args = tuple() if func_name == "forceconstants" else ("dfpt",)
4748
search_method = getattr(
4849
rester,
4950
f"get_{func_name}_from_material_id",
5051
)
51-
assert isinstance(
52-
search_method("mp-149", "dfpt"), schema if use_document_model else dict
53-
)
52+
53+
if func_name != "forceconstants":
54+
assert isinstance(
55+
search_method("mp-149", *args), schema if use_document_model else dict
56+
)
5457

5558
with pytest.raises(MPRestError, match="No object found"):
56-
_ = search_method("mp-0", "dfpt")
59+
_ = search_method("mp-0", *args)
5760

5861

5962
@pytest.mark.skipif(os.getenv("MP_API_KEY") is None, reason="No API key found.")

0 commit comments

Comments
 (0)