Exports an assembly without specifying a unit and verifies the STEP file header defaults to millimeters.
(tmp_path_factory)
| 921 | |
| 922 | |
| 923 | def test_step_export_assembly_unit_default(tmp_path_factory): |
| 924 | """ |
| 925 | Exports an assembly without specifying a unit and verifies the STEP |
| 926 | file header defaults to millimeters. |
| 927 | """ |
| 928 | |
| 929 | tmpdir = tmp_path_factory.mktemp("unit_assy") |
| 930 | mm_path = os.path.join(tmpdir, "assy_unit_default.step") |
| 931 | |
| 932 | assy = cq.Assembly() |
| 933 | assy.add(cq.Workplane().box(1, 1, 1), name="box") |
| 934 | exportAssembly(assy, mm_path) |
| 935 | |
| 936 | with open(mm_path, "r") as f: |
| 937 | content = f.read() |
| 938 | |
| 939 | assert "MILLI" in content |
| 940 | |
| 941 | |
| 942 | def test_step_export_assembly_unit_meters(tmp_path_factory): |
nothing calls this directly
no test coverage detected