MCPcopy
hub / github.com/CadQuery/cadquery / test_step_export_assembly_unit_default

Function test_step_export_assembly_unit_default

tests/test_assembly.py:923–939  ·  view source on GitHub ↗

Exports an assembly without specifying a unit and verifies the STEP file header defaults to millimeters.

(tmp_path_factory)

Source from the content-addressed store, hash-verified

921
922
923def 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
942def test_step_export_assembly_unit_meters(tmp_path_factory):

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
exportAssemblyFunction · 0.90
boxMethod · 0.80

Tested by

no test coverage detected