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

Function check_nodes

tests/test_assembly.py:1841–1855  ·  view source on GitHub ↗
(doc, expected)

Source from the content-addressed store, hash-verified

1839)
1840def test_colors_fused_assy(assy_fixture, expected, request, tmpdir):
1841 def check_nodes(doc, expected):
1842 nodes = get_doc_nodes(doc, False)
1843 assert len(nodes) == 1
1844 count_face = 0
1845 if "name" in expected:
1846 assert expected["name"] == nodes[0]["name"]
1847 for props in expected["faces"]:
1848 for props_doc in nodes[0]["faces"]:
1849 if (
1850 pytest.approx(props["center"], abs=1e-6) == props_doc["center"]
1851 and pytest.approx(props["color"], abs=1e-3) == props_doc["color"]
1852 ):
1853 count_face += 1
1854
1855 assert len(expected["faces"]) == count_face
1856
1857 assy = request.getfixturevalue(assy_fixture)
1858 _, doc = toFusedCAF(assy, False)

Callers 1

test_colors_fused_assyFunction · 0.85

Calls 1

get_doc_nodesFunction · 0.85

Tested by

no test coverage detected