From 2a3f2617d5403591c838a58d8b32ed3a3662d185 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Roos?= Date: Mon, 25 Sep 2023 13:57:37 +0200 Subject: [PATCH] run new test only if the latest server version is used. --- tests/composite_model_test.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tests/composite_model_test.py b/tests/composite_model_test.py index 4f3ee4668..76cba588b 100644 --- a/tests/composite_model_test.py +++ b/tests/composite_model_test.py @@ -14,7 +14,7 @@ from ansys.dpf.composites.layup_info import LayerProperty, get_analysis_ply_index_to_name_map from ansys.dpf.composites.layup_info.material_properties import MaterialProperty from ansys.dpf.composites.result_definition import FailureMeasureEnum -from ansys.dpf.composites.server_helpers import version_older_than +from ansys.dpf.composites.server_helpers import version_equal_or_later, version_older_than from .helper import Timer @@ -83,16 +83,17 @@ def test_basic_functionality_of_composite_model(dpf_server, data_files, distribu assert [ply["id"] for ply in sampling_point.analysis_plies] == analysis_ply_ids - ref_material_names = [ - "Epoxy Carbon UD (230 GPa) Prepreg", - "Epoxy Carbon Woven (230 GPa) Wet", - "Honeycomb", - "Structural Steel", - ] - mat_names = composite_model.material_names - assert len(mat_names) == len(ref_material_names) - for mat_name in ref_material_names: - assert mat_name in mat_names.keys() + if version_equal_or_later(dpf_server, "7.0"): + ref_material_names = [ + "Epoxy Carbon UD (230 GPa) Prepreg", + "Epoxy Carbon Woven (230 GPa) Wet", + "Honeycomb", + "Structural Steel", + ] + mat_names = composite_model.material_names + assert len(mat_names) == len(ref_material_names) + for mat_name in ref_material_names: + assert mat_name in mat_names.keys() timer.add("After getting properties")