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

Function test_step_export_assembly_unit_meters

tests/test_assembly.py:942–959  ·  view source on GitHub ↗

Exports an assembly with unit="M" and verifies the STEP file header declares meters.

(tmp_path_factory)

Source from the content-addressed store, hash-verified

940
941
942def test_step_export_assembly_unit_meters(tmp_path_factory):
943 """
944 Exports an assembly with unit="M" and verifies the STEP file header
945 declares meters.
946 """
947
948 tmpdir = tmp_path_factory.mktemp("unit_assy_m")
949 m_path = os.path.join(tmpdir, "assy_unit_meters.step")
950
951 assy = cq.Assembly()
952 assy.add(cq.Workplane().box(1, 1, 1), name="box")
953 exportAssembly(assy, m_path, unit="M")
954
955 with open(m_path, "r") as f:
956 content = f.read()
957
958 assert "MILLI" not in content
959 assert "METRE" in content
960
961
962def test_step_export_meta_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