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

Function test_example

tests/test_examples.py:65–82  ·  view source on GitHub ↗
(code, path, tmpdir)

Source from the content-addressed store, hash-verified

63 "code, path", chain(find_examples(), find_examples_in_docs()), ids=count(0)
64)
65def test_example(code, path, tmpdir):
66
67 # build
68 with chdir(tmpdir):
69 # tmpdir is for future use; currently there are no examples that export files
70 res = cqgi.parse(code).build()
71
72 assert res.exception is None
73
74 # check if the resulting objects are valid
75 for r in res.results:
76 r = r.shape
77 if isinstance(r, cq.Workplane):
78 for v in r.vals():
79 if isinstance(v, cq.Shape):
80 assert v.isValid()
81 elif isinstance(r, cq.Shape):
82 assert r.isValid()

Callers

nothing calls this directly

Calls 3

isValidMethod · 0.80
buildMethod · 0.45
valsMethod · 0.45

Tested by

no test coverage detected