Tests the assembly with only a top level shape and no children. The resulting STEP is imported again to test it.
(tmpdir)
| 212 | |
| 213 | |
| 214 | def test_fused_assembly_top_level_only(tmpdir): |
| 215 | """ |
| 216 | Tests the assembly with only a top level shape and no children. |
| 217 | The resulting STEP is imported again to test it. |
| 218 | """ |
| 219 | |
| 220 | # Create the assembly |
| 221 | body = Workplane().box(10, 10, 10) |
| 222 | assy = Assembly(body) |
| 223 | |
| 224 | # Export the assembly |
| 225 | step_path = os.path.join(tmpdir, "top_level_only_fused_assembly.step") |
| 226 | assy.save( |
| 227 | path=str(step_path), |
| 228 | exportType=exporters.ExportTypes.STEP, |
| 229 | mode=exporters.assembly.ExportModes.FUSED, |
| 230 | ) |
| 231 | |
| 232 | # Import the assembly and make sure it acts as expected |
| 233 | model = importers.importStep(step_path) |
| 234 | assert model.solids().size() == 1 |
| 235 | |
| 236 | |
| 237 | def test_fused_assembly_top_level_with_children(tmpdir): |