Skip to content

Commit

Permalink
Ret again
Browse files Browse the repository at this point in the history
  • Loading branch information
enavarro51 committed Aug 1, 2023
1 parent acaa7b7 commit 12e917f
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/retworkx_backwards_compat/digraph/test_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,23 @@ def test_digraph_to_dot_to_file(self):
def test_digraph_empty_dicts(self):
graph = retworkx.directed_gnp_random_graph(3, 0.9, seed=42)
dot_str = graph.to_dot(lambda _: {}, lambda _: {})
self.assertEqual("digraph {\n0 ;\n1 ;\n2 ;\n0 -> 1 ;\n0 -> 2 ;\n}\n", dot_str)
self.assertEqual(
"digraph {\n0 ;\n1 ;\n2 ;\n0 -> 1 ;\n0 -> 2 ;\n1 -> 2 ;\n2 -> 0 ;\n2 -> 1 ;\n}\n",
dot_str,
)

def test_digraph_graph_attrs(self):
graph = retworkx.directed_gnp_random_graph(3, 0.9, seed=42)
dot_str = graph.to_dot(lambda _: {}, lambda _: {}, {"bgcolor": "red"})
self.assertEqual(
"digraph {\nbgcolor=red ;\n0 ;\n1 ;\n2 ;\n0 -> 1 ;\n" "0 -> 2 ;\n}\n",
"digraph {\nbgcolor=red ;\n0 ;\n1 ;\n2 ;\n0 -> 1 ;\n0 -> 2 ;\n1 -> 2 ;\n2 -> 0 ;\n2 -> 1 ;\n}\n",
dot_str,
)

def test_digraph_no_args(self):
graph = retworkx.directed_gnp_random_graph(3, 0.95, seed=24)
dot_str = graph.to_dot()
self.assertEqual("digraph {\n0 ;\n1 ;\n2 ;\n0 -> 1 ;\n0 -> 2 ;\n}\n", dot_str)
self.assertEqual(
"digraph {\n0 ;\n1 ;\n2 ;\n0 -> 2 ;\n1 -> 2 ;\n1 -> 0 ;\n2 -> 0 ;\n2 -> 1 ;\n}\n",
dot_str,
)

0 comments on commit 12e917f

Please sign in to comment.