MCPcopy Index your code
hub / github.com/CadQuery/cadquery / test_step_export_meta_unit_meters

Function test_step_export_meta_unit_meters

tests/test_assembly.py:962–979  ·  view source on GitHub ↗

Exports a meta STEP file with unit="M" and verifies the header declares meters.

(tmp_path_factory)

Source from the content-addressed store, hash-verified

960
961
962def test_step_export_meta_unit_meters(tmp_path_factory):
963 """
964 Exports a meta STEP file with unit="M" and verifies the header
965 declares meters.
966 """
967
968 tmpdir = tmp_path_factory.mktemp("unit_meta_m")
969 m_path = os.path.join(tmpdir, "meta_unit_meters.step")
970
971 assy = cq.Assembly()
972 assy.add(cq.Workplane().box(1, 1, 1), name="box")
973 exportStepMeta(assy, m_path, unit="M")
974
975 with open(m_path, "r") as f:
976 content = f.read()
977
978 assert "MILLI" not in content
979 assert "METRE" in content
980
981
982def test_step_export_assembly_output_unit(tmp_path_factory):

Callers

nothing calls this directly

Calls 3

addMethod · 0.95
exportStepMetaFunction · 0.90
boxMethod · 0.80

Tested by

no test coverage detected