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

Function test_stl_binary

tests/test_exporters.py:804–822  ·  view source on GitHub ↗

:param tmpdir: temporary directory fixture :param box123: box fixture :param id: The index or id; output filename is _ .stl :param opt: The export opt dict :param matchval: Check that the file starts with the specified value

(tmpdir, box123, id, opt, matchval)

Source from the content-addressed store, hash-verified

802 ],
803)
804def test_stl_binary(tmpdir, box123, id, opt, matchval):
805 """
806 :param tmpdir: temporary directory fixture
807 :param box123: box fixture
808 :param id: The index or id; output filename is <test name>_<id>.stl
809 :param opt: The export opt dict
810 :param matchval: Check that the file starts with the specified value
811 """
812
813 fpath = tmpdir.joinpath(f"stl_binary_{id}.stl").resolve()
814 assert not fpath.exists()
815
816 assert matchval
817
818 exporters.export(box123, str(fpath), None, 0.1, 0.1, opt)
819
820 with open(fpath, "rb") as f:
821 r = f.read(len(matchval))
822 assert r == matchval
823
824
825def test_assy_vtk_rotation(tmpdir):

Callers

nothing calls this directly

Calls 1

exportMethod · 0.45

Tested by

no test coverage detected