diff --git a/doc/changelog.d/2199.test.md b/doc/changelog.d/2199.test.md new file mode 100644 index 0000000000..1d760464e2 --- /dev/null +++ b/doc/changelog.d/2199.test.md @@ -0,0 +1 @@ +New test and remove skip diff --git a/src/ansys/geometry/core/designer/design.py b/src/ansys/geometry/core/designer/design.py index 172f3d21af..437597dd4f 100644 --- a/src/ansys/geometry/core/designer/design.py +++ b/src/ansys/geometry/core/designer/design.py @@ -286,7 +286,7 @@ def download( format : DesignFileFormat, default: DesignFileFormat.SCDOCX Format for the file to save to. write_body_facets : bool, default: False - Option to write body facets into the saved file. SCDOCX only, 26R1 and later. + Option to write body facets into the saved file. SCDOCX and DISCO only, 26R1 and later. """ # Sanity checks on inputs if isinstance(file_location, str): diff --git a/tests/_incompatible_tests.yml b/tests/_incompatible_tests.yml index fe09f252dd..32d51e47eb 100644 --- a/tests/_incompatible_tests.yml +++ b/tests/_incompatible_tests.yml @@ -104,7 +104,8 @@ backends: - tests/integration/test_design_import.py::test_named_selections_after_file_open - tests/integration/test_design_import.py::test_file_insert_import_named_selections_post_import # Export body facets add in 26.1 - - tests/integration/test_design.py::test_write_body_facets_on_save + - tests/integration/test_design.py::test_write_body_facets_on_save[scdocx-None] + - tests/integration/test_design.py::test_write_body_facets_on_save[dsco-DISCO] - version: "24.2" incompatible_tests: @@ -203,7 +204,8 @@ backends: - tests/integration/test_design_import.py::test_named_selections_after_file_open - tests/integration/test_design_import.py::test_file_insert_import_named_selections_post_import # Export body facets add in 26.1 - - tests/integration/test_design.py::test_write_body_facets_on_save + - tests/integration/test_design.py::test_write_body_facets_on_save[scdocx-None] + - tests/integration/test_design.py::test_write_body_facets_on_save[dsco-DISCO] - version: "25.1" incompatible_tests: @@ -271,7 +273,8 @@ backends: - tests/integration/test_design_import.py::test_named_selections_after_file_open - tests/integration/test_design_import.py::test_file_insert_import_named_selections_post_import # Export body facets add in 26.1 - - tests/integration/test_design.py::test_write_body_facets_on_save + - tests/integration/test_design.py::test_write_body_facets_on_save[scdocx-None] + - tests/integration/test_design.py::test_write_body_facets_on_save[dsco-DISCO] - version: "25.2" incompatible_tests: @@ -303,4 +306,5 @@ backends: - tests/integration/test_design_import.py::test_named_selections_after_file_open - tests/integration/test_design_import.py::test_file_insert_import_named_selections_post_import # Export body facets add in 26.1 - - tests/integration/test_design.py::test_write_body_facets_on_save + - tests/integration/test_design.py::test_write_body_facets_on_save[scdocx-None] + - tests/integration/test_design.py::test_write_body_facets_on_save[dsco-DISCO] diff --git a/tests/integration/test_design.py b/tests/integration/test_design.py index d5236b93a1..737e49510f 100644 --- a/tests/integration/test_design.py +++ b/tests/integration/test_design.py @@ -3665,16 +3665,33 @@ def test_component_make_independent(modeler: Modeler): assert not Accuracy.length_is_equal(comp.bodies[0].volume.m, face.body.volume.m) -def test_write_body_facets_on_save(modeler: Modeler, tmp_path_factory: pytest.TempPathFactory): +@pytest.mark.parametrize( + "file_extension, design_format", + [ + ("scdocx", None), # For .scdocx files + ("dsco", DesignFileFormat.DISCO), # For .dsco files + ], +) +def test_write_body_facets_on_save( + modeler: Modeler, tmp_path_factory: pytest.TempPathFactory, file_extension: str, design_format +): design = modeler.open_file(Path(FILES_DIR, "cars.scdocx")) # First file without body facets - filepath_no_facets = tmp_path_factory.mktemp("test_design") / "cars_no_facets.scdocx" - design.download(filepath_no_facets) + filepath_no_facets = tmp_path_factory.mktemp("test_design") / f"cars_no_facets.{file_extension}" + if design_format: + design.download(filepath_no_facets, design_format) + else: + design.download(filepath_no_facets) # Second file with body facets - filepath_with_facets = tmp_path_factory.mktemp("test_design") / "cars_with_facets.scdocx" - design.download(filepath_with_facets, write_body_facets=True) + filepath_with_facets = ( + tmp_path_factory.mktemp("test_design") / f"cars_with_facets.{file_extension}" + ) + if design_format: + design.download(filepath_with_facets, design_format, write_body_facets=True) + else: + design.download(filepath_with_facets, write_body_facets=True) # Compare file sizes size_no_facets = filepath_no_facets.stat().st_size diff --git a/tests/integration/test_design_export.py b/tests/integration/test_design_export.py index 20bc191612..5e9bd02eac 100644 --- a/tests/integration/test_design_export.py +++ b/tests/integration/test_design_export.py @@ -382,7 +382,6 @@ def test_import_export_reimport_design_scdocx( assert len(design.components[0].components[0].bodies) == 3 -@pytest.mark.skip(reason="Re-import of x_t files broke") def test_import_export_reimport_design_x_t( modeler: Modeler, tmp_path_factory: pytest.TempPathFactory ): @@ -441,7 +440,6 @@ def test_import_export_glb(modeler: Modeler, tmp_path_factory: pytest.TempPathFa assert output_glb_path.stat().st_size > 0, f"GLB file {output_glb_path} is empty." -@pytest.mark.skip(reason="Re-import of x_t files broke") @pytest.mark.parametrize( "file_format, extension, original_file, expected_components, expected_bodies", [