Skip to content

Commit fcc42a7

Browse files
committed
adding file size assert to ensure file size includes facets
1 parent 454b6a2 commit fcc42a7

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

tests/integration/test_design.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3778,7 +3778,8 @@ def test_vertices(modeler: Modeler, tmp_path_factory: pytest.TempPathFactory):
37783778

37793779
location = tmp_path_factory.mktemp("test_export_to_scdocx")
37803780
file_location = location / f"{design.name}.scdocx"
3781-
design.export_to_scdocx(location, write_body_facets=True)
3781+
exported_file = design.export_to_scdocx(location, write_body_facets=True)
3782+
assert os.path.getsize(exported_file) == pytest.approx(216642, 1e-3, 100)
37823783
assert file_location.exists()
37833784
design_read = modeler.open_file(file_location)
37843785
assert len(design_read.named_selections) == 5

tests/integration/test_design_export.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
# SOFTWARE.
2222
"""Test design export functionality."""
2323

24+
import os
2425
from pathlib import Path
2526

2627
import numpy as np
@@ -219,7 +220,10 @@ def test_export_to_disco(modeler: Modeler, tmp_path_factory: pytest.TempPathFact
219220
file_location = location / f"{design.name}.dsco"
220221

221222
# Export to dsco
222-
design.export_to_disco(location, write_body_facets=True)
223+
exported_file = design.export_to_disco(location, write_body_facets=True)
224+
225+
# Checking file size to ensure facets are exported
226+
assert os.path.getsize(exported_file) == pytest.approx(53844, 1e-3, 100)
223227

224228
# Check the exported file
225229
assert file_location.exists()

0 commit comments

Comments
 (0)