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

Method test_invoke

tests/test_cadquery.py:5802–5816  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5800 assert w[[0, 1]].solids().size() == 2
5801
5802 def test_invoke(self):
5803
5804 w = Workplane().rarray(2, 0, 5, 1).box(1, 1, 1, combine=False)
5805
5806 # builtin
5807 assert w.invoke(print).size() == 5
5808 # arity 0
5809 assert w.invoke(lambda: 1).size() == 5
5810 # arity 1 and no return
5811 assert w.invoke(lambda x: None).size() == 5
5812 # arity 1
5813 assert w.invoke(lambda x: x.newObject([x.val()])).size() == 1
5814 # test exception with wrong arity
5815 with raises(ValueError):
5816 w.invoke(lambda x, y: 1)
5817
5818 def test_tessellate(self):
5819

Callers

nothing calls this directly

Calls 7

WorkplaneClass · 0.85
boxMethod · 0.80
newObjectMethod · 0.80
rarrayMethod · 0.45
sizeMethod · 0.45
invokeMethod · 0.45
valMethod · 0.45

Tested by

no test coverage detected