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

Method test_repr_javascript

tests/test_jupyter.py:8–22  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

6
7class TestJupyter(BaseTest):
8 def test_repr_javascript(self):
9 cube = cq.Workplane("XY").box(1, 1, 1)
10 assy = cq.Assembly().add(cube)
11 shape = cube.val()
12
13 self.assertIsInstance(shape, cq.occ_impl.shapes.Solid)
14
15 # Test no exception on rendering to js
16 js1 = shape._repr_javascript_()
17 js2 = cube._repr_javascript_()
18 js3 = assy._repr_javascript_()
19
20 assert "function render" in js1
21 assert "function render" in js2
22 assert "function render" in js3
23
24 def test_display_error(self):
25

Callers

nothing calls this directly

Calls 4

boxMethod · 0.80
addMethod · 0.45
valMethod · 0.45
_repr_javascript_Method · 0.45

Tested by

no test coverage detected