From 1927b0bf40a9bc29c1a15345f0c6819caa3276cf Mon Sep 17 00:00:00 2001 From: Edan Bainglass Date: Mon, 6 Jan 2025 15:17:27 +0000 Subject: [PATCH] Add symmetry group test --- tests/test_result.py | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/tests/test_result.py b/tests/test_result.py index fe682d938..abbcbc8ca 100644 --- a/tests/test_result.py +++ b/tests/test_result.py @@ -1,3 +1,4 @@ +import pytest from bs4 import BeautifulSoup from aiidalab_qe.app.main import App @@ -78,6 +79,35 @@ def test_summary_report_advanced_settings(data_regression, generate_qeapp_workch assert moments["Si"] == 0.1 +@pytest.mark.parametrize( + ("pbc", "symmetry_key"), + [ + [(False, False, False), "point_group"], # 0D + [(True, False, False), "space_group"], # 1D + [(True, True, False), "space_group"], # 2D + [(True, True, True), "space_group"], # 3D + ], +) +def test_summary_report_symmetry_group( + generate_qeapp_workchain, + generate_structure_data, + pbc, + symmetry_key, +): + """Test summary report includes correct symmetry group for all system dimension.""" + + system = generate_structure_data("silicon", pbc=pbc) + workchain = generate_qeapp_workchain( + structure=system, + run_bands=False, + relax_type="none", + ) + model = WorkChainSummaryModel() + model.process_uuid = workchain.node.uuid + report_parameters = model._generate_report_parameters() + assert symmetry_key in report_parameters["initial_structure_properties"] + + def test_summary_view(generate_qeapp_workchain): """Test the report html can be properly generated.""" workchain = generate_qeapp_workchain()