Skip to content

Commit ae41607

Browse files
test: new test and remove skip (#2199)
Co-authored-by: pyansys-ci-bot <[email protected]>
1 parent 824fc88 commit ae41607

File tree

5 files changed

+32
-12
lines changed

5 files changed

+32
-12
lines changed

doc/changelog.d/2199.test.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
New test and remove skip

src/ansys/geometry/core/designer/design.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,7 @@ def download(
286286
format : DesignFileFormat, default: DesignFileFormat.SCDOCX
287287
Format for the file to save to.
288288
write_body_facets : bool, default: False
289-
Option to write body facets into the saved file. SCDOCX only, 26R1 and later.
289+
Option to write body facets into the saved file. SCDOCX and DISCO only, 26R1 and later.
290290
"""
291291
# Sanity checks on inputs
292292
if isinstance(file_location, str):

tests/_incompatible_tests.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ backends:
104104
- tests/integration/test_design_import.py::test_named_selections_after_file_open
105105
- tests/integration/test_design_import.py::test_file_insert_import_named_selections_post_import
106106
# Export body facets add in 26.1
107-
- tests/integration/test_design.py::test_write_body_facets_on_save
107+
- tests/integration/test_design.py::test_write_body_facets_on_save[scdocx-None]
108+
- tests/integration/test_design.py::test_write_body_facets_on_save[dsco-DISCO]
108109

109110
- version: "24.2"
110111
incompatible_tests:
@@ -203,7 +204,8 @@ backends:
203204
- tests/integration/test_design_import.py::test_named_selections_after_file_open
204205
- tests/integration/test_design_import.py::test_file_insert_import_named_selections_post_import
205206
# Export body facets add in 26.1
206-
- tests/integration/test_design.py::test_write_body_facets_on_save
207+
- tests/integration/test_design.py::test_write_body_facets_on_save[scdocx-None]
208+
- tests/integration/test_design.py::test_write_body_facets_on_save[dsco-DISCO]
207209

208210
- version: "25.1"
209211
incompatible_tests:
@@ -271,7 +273,8 @@ backends:
271273
- tests/integration/test_design_import.py::test_named_selections_after_file_open
272274
- tests/integration/test_design_import.py::test_file_insert_import_named_selections_post_import
273275
# Export body facets add in 26.1
274-
- tests/integration/test_design.py::test_write_body_facets_on_save
276+
- tests/integration/test_design.py::test_write_body_facets_on_save[scdocx-None]
277+
- tests/integration/test_design.py::test_write_body_facets_on_save[dsco-DISCO]
275278

276279
- version: "25.2"
277280
incompatible_tests:
@@ -303,4 +306,5 @@ backends:
303306
- tests/integration/test_design_import.py::test_named_selections_after_file_open
304307
- tests/integration/test_design_import.py::test_file_insert_import_named_selections_post_import
305308
# Export body facets add in 26.1
306-
- tests/integration/test_design.py::test_write_body_facets_on_save
309+
- tests/integration/test_design.py::test_write_body_facets_on_save[scdocx-None]
310+
- tests/integration/test_design.py::test_write_body_facets_on_save[dsco-DISCO]

tests/integration/test_design.py

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3665,16 +3665,33 @@ def test_component_make_independent(modeler: Modeler):
36653665
assert not Accuracy.length_is_equal(comp.bodies[0].volume.m, face.body.volume.m)
36663666

36673667

3668-
def test_write_body_facets_on_save(modeler: Modeler, tmp_path_factory: pytest.TempPathFactory):
3668+
@pytest.mark.parametrize(
3669+
"file_extension, design_format",
3670+
[
3671+
("scdocx", None), # For .scdocx files
3672+
("dsco", DesignFileFormat.DISCO), # For .dsco files
3673+
],
3674+
)
3675+
def test_write_body_facets_on_save(
3676+
modeler: Modeler, tmp_path_factory: pytest.TempPathFactory, file_extension: str, design_format
3677+
):
36693678
design = modeler.open_file(Path(FILES_DIR, "cars.scdocx"))
36703679

36713680
# First file without body facets
3672-
filepath_no_facets = tmp_path_factory.mktemp("test_design") / "cars_no_facets.scdocx"
3673-
design.download(filepath_no_facets)
3681+
filepath_no_facets = tmp_path_factory.mktemp("test_design") / f"cars_no_facets.{file_extension}"
3682+
if design_format:
3683+
design.download(filepath_no_facets, design_format)
3684+
else:
3685+
design.download(filepath_no_facets)
36743686

36753687
# Second file with body facets
3676-
filepath_with_facets = tmp_path_factory.mktemp("test_design") / "cars_with_facets.scdocx"
3677-
design.download(filepath_with_facets, write_body_facets=True)
3688+
filepath_with_facets = (
3689+
tmp_path_factory.mktemp("test_design") / f"cars_with_facets.{file_extension}"
3690+
)
3691+
if design_format:
3692+
design.download(filepath_with_facets, design_format, write_body_facets=True)
3693+
else:
3694+
design.download(filepath_with_facets, write_body_facets=True)
36783695

36793696
# Compare file sizes
36803697
size_no_facets = filepath_no_facets.stat().st_size

tests/integration/test_design_export.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ def test_import_export_reimport_design_scdocx(
382382
assert len(design.components[0].components[0].bodies) == 3
383383

384384

385-
@pytest.mark.skip(reason="Re-import of x_t files broke")
386385
def test_import_export_reimport_design_x_t(
387386
modeler: Modeler, tmp_path_factory: pytest.TempPathFactory
388387
):
@@ -441,7 +440,6 @@ def test_import_export_glb(modeler: Modeler, tmp_path_factory: pytest.TempPathFa
441440
assert output_glb_path.stat().st_size > 0, f"GLB file {output_glb_path} is empty."
442441

443442

444-
@pytest.mark.skip(reason="Re-import of x_t files broke")
445443
@pytest.mark.parametrize(
446444
"file_format, extension, original_file, expected_components, expected_bodies",
447445
[

0 commit comments

Comments
 (0)