diff --git a/src/ansys/dpf/composites/_composite_model_impl.py b/src/ansys/dpf/composites/_composite_model_impl.py index 2d57f4302..84c9557c3 100644 --- a/src/ansys/dpf/composites/_composite_model_impl.py +++ b/src/ansys/dpf/composites/_composite_model_impl.py @@ -154,9 +154,11 @@ def material_names(self) -> Dict[str, int]: try: helper_op = dpf.Operator("composite::materials_container_helper") except Exception as exc: - raise RuntimeError(f"Operator composite::materials_container_helper doesn't exist. " - f"This could be because the server version is 2024 R1-pre0. Please use " - f"the latest preview or the unified installer. Error: {exc}") from exc + raise RuntimeError( + f"Operator composite::materials_container_helper doesn't exist. " + f"This could be because the server version is 2024 R1-pre0. Please use " + f"the latest preview or the unified installer. Error: {exc}" + ) from exc helper_op.inputs.materials_container(self._material_operators.material_provider.outputs) string_field = helper_op.outputs.material_names() diff --git a/tests/composite_model_test.py b/tests/composite_model_test.py index 585980c2d..4f3ee4668 100644 --- a/tests/composite_model_test.py +++ b/tests/composite_model_test.py @@ -83,16 +83,16 @@ 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": 3, - "Epoxy Carbon Woven (230 GPa) Wet": 2, - "Honeycomb": 4, - "Structural Steel": 1, - } + 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, dpf_mat_id in ref_material_names.items(): - assert mat_names[mat_name] == dpf_mat_id + for mat_name in ref_material_names: + assert mat_name in mat_names.keys() timer.add("After getting properties")