From dcc861e04e442e351886343dd4354d8eaf6dd1a7 Mon Sep 17 00:00:00 2001 From: Shyam D Date: Sat, 10 Jul 2021 10:10:32 -0700 Subject: [PATCH] add tests for deprecated material construction --- tests/emmet-core/vasp/test_materials.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/emmet-core/vasp/test_materials.py b/tests/emmet-core/vasp/test_materials.py index 33222945bf..ba2883dfe7 100644 --- a/tests/emmet-core/vasp/test_materials.py +++ b/tests/emmet-core/vasp/test_materials.py @@ -32,5 +32,18 @@ def test_make_mat(test_tasks): MaterialsDoc.from_tasks(bad_task_group, use_statics=False) +def test_make_deprecated_mat(test_tasks): + bad_task_group = [ + task for task in test_tasks if task.task_type != TaskType.Structure_Optimization + ] + + material = MaterialsDoc.construct_deprecated_material(bad_task_group) + + assert material.deprecated + assert material.formula_pretty == "Si" + assert len(material.task_ids) == 3 + assert material.entries is None + + def test_schema(): MaterialsDoc.schema()