Skip to content

Commit

Permalink
run new test only if the latest server version is used.
Browse files Browse the repository at this point in the history
  • Loading branch information
roosre committed Sep 25, 2023
1 parent c4bb351 commit 2a3f261
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions tests/composite_model_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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")

Expand Down

0 comments on commit 2a3f261

Please sign in to comment.