@@ -178,17 +178,29 @@ def test_assembly(simple_assy, nested_assy):
178
178
assert kvs [- 1 ][0 ] == "TOP"
179
179
180
180
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
+ )
184
191
185
- w = cq .importers .importStep ("nested.step" )
192
+ w = cq .importers .importStep (nested_path )
193
+ o = cq .importers .importStep (nested_options_path )
186
194
assert w .solids ().size () == 4
195
+ assert o .solids ().size () == 4
187
196
188
197
# check that locations were applied correctly
189
198
c = cq .Compound .makeCompound (w .solids ().vals ()).Center ()
190
199
c .toTuple ()
191
200
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 )
192
204
193
205
194
206
def test_native_export (simple_assy ):
0 commit comments