| 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 | |