MCPcopy
hub / github.com/ManimCommunity/manim / test_cell

Function test_cell

tests/utils/test_polylabels.py:109–121  ·  view source on GitHub ↗
(center, h, rings)

Source from the content-addressed store, hash-verified

107 ],
108)
109def test_cell(center, h, rings):
110 polygon = Polygon(rings)
111 cell = Cell(center, h, polygon)
112 assert isinstance(cell.d, float)
113 assert isinstance(cell.p, float)
114 assert np.allclose(cell.c, center)
115 assert cell.h == h
116
117 other = Cell(np.add(center, [0.1, 0.1]), h, polygon)
118 assert (cell < other) == (cell.d < other.d)
119 assert (cell > other) == (cell.d > other.d)
120 assert (cell <= other) == (cell.d <= other.d)
121 assert (cell >= other) == (cell.d >= other.d)
122
123
124@pytest.mark.parametrize(

Callers

nothing calls this directly

Calls 3

PolygonClass · 0.90
CellClass · 0.90
addMethod · 0.45

Tested by

no test coverage detected