Skip to content

Commit

Permalink
Test manual graph creation
Browse files Browse the repository at this point in the history
  • Loading branch information
tlcyr4 committed Jul 2, 2024
1 parent 8b5a789 commit 7da7b6d
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Binary file not shown.
35 changes: 35 additions & 0 deletions tests/test_graphical_units/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,38 @@ def test_digraph_add_edge(scene):
)
scene.play(g.animate.add_edges((0, 1)))
scene.wait(0.1)


@frames_comparison(last_frame=False)
def test_graph_create(scene):
graph = Graph(
vertices=[1, 2, 3, 4, 5],
edges=[
(1, 2),
(1, 3),
(1, 4),
(1, 5),
(2, 3),
(2, 4),
(2, 5),
(3, 4),
(3, 5),
(4, 5),
],
vertex_type=Circle,
vertex_config={"radius": 0.25},
)
scene.play(
AnimationGroup(
*(Create(vertex) for vertex in graph.vertices.values()),
lag_ratio=0.1,
),
run_time=2,
)
scene.play(
AnimationGroup(
*(Create(edge) for edge in graph.edges.values()),
lag_ratio=0.1,
),
run_time=2,
)

0 comments on commit 7da7b6d

Please sign in to comment.