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

Function test_custom_graph_layout_dict

tests/module/mobject/test_graph.py:131–138  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

129
130
131def test_custom_graph_layout_dict():
132 G = Graph(
133 [1, 2, 3], [(1, 2), (2, 3)], layout={1: [0, 0, 0], 2: [1, 1, 0], 3: [1, -1, 0]}
134 )
135 assert str(G) == "Undirected graph on 3 vertices and 2 edges"
136 assert all(G.vertices[1].get_center() == [0, 0, 0])
137 assert all(G.vertices[2].get_center() == [1, 1, 0])
138 assert all(G.vertices[3].get_center() == [1, -1, 0])
139
140
141def test_graph_layouts():

Callers

nothing calls this directly

Calls 2

GraphClass · 0.90
get_centerMethod · 0.45

Tested by

no test coverage detected