Skip to content

Commit 3c56af3

Browse files
committed
Added a test for the new options
1 parent 2a9b50a commit 3c56af3

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

tests/test_assembly.py

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,29 @@ def test_assembly(simple_assy, nested_assy):
178178
assert kvs[-1][0] == "TOP"
179179

180180

181-
def test_step_export(nested_assy):
182-
183-
exportAssembly(nested_assy, "nested.step")
181+
def test_step_export(nested_assy, tmp_path_factory):
182+
# Use a temporary directory
183+
tmpdir = tmp_path_factory.mktemp("out")
184+
nested_path = os.path.join(tmpdir, "nested.step")
185+
nested_options_path = os.path.join(tmpdir, "nested_options.step")
186+
187+
exportAssembly(nested_assy, nested_path)
188+
exportAssembly(
189+
nested_assy, nested_options_path, write_pcurves=False, precision_mode=0
190+
)
184191

185-
w = cq.importers.importStep("nested.step")
192+
w = cq.importers.importStep(nested_path)
193+
o = cq.importers.importStep(nested_options_path)
186194
assert w.solids().size() == 4
195+
assert o.solids().size() == 4
187196

188197
# check that locations were applied correctly
189198
c = cq.Compound.makeCompound(w.solids().vals()).Center()
190199
c.toTuple()
191200
assert pytest.approx(c.toTuple()) == (0, 4, 0)
201+
c2 = cq.Compound.makeCompound(o.solids().vals()).Center()
202+
c2.toTuple()
203+
assert pytest.approx(c2.toTuple()) == (0, 4, 0)
192204

193205

194206
def test_native_export(simple_assy):

0 commit comments

Comments
 (0)