Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Oct 29, 2023
1 parent 45341c5 commit 0d924f1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/module/mobject/test_graph.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
from __future__ import annotations

import pytest

from manim import DiGraph, Graph, Scene, Text, tempconfig


def test_graph_creation():
vertices = [1, 2, 3, 4]
edges = [(1, 2), (2, 3), (3, 4), (4, 1)]
Expand Down Expand Up @@ -101,11 +103,13 @@ def test_custom_animation_mobject_list():
assert str(G) == "Undirected graph on 3 vertices and 0 edges"
assert scene.mobjects == [G]


def test_tree_layout_no_root_error():
with pytest.raises(ValueError) as excinfo:
G = Graph([1, 2, 3], [(1, 2), (2, 3)], layout="tree")
assert str(excinfo.value) == "The tree layout requires the root_vertex parameter"


def test_tree_layout_not_tree_error():
with pytest.raises(ValueError) as excinfo:
G = Graph([1, 2, 3], [(1, 2), (2, 3), (3, 1)], layout="tree", root_vertex=1)
Expand Down

0 comments on commit 0d924f1

Please sign in to comment.