Skip to content

Commit

Permalink
Ret tests
Browse files Browse the repository at this point in the history
  • Loading branch information
enavarro51 committed Aug 1, 2023
1 parent 01a87d8 commit ac5541a
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions tests/retworkx_backwards_compat/digraph/test_dot.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,25 +55,19 @@ def test_digraph_to_dot_to_file(self):
self.assertEqual(expected, res)

def test_digraph_empty_dicts(self):
graph = rustworkx.directed_gnp_random_graph(3, 0.9, seed=42)
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 ;\n1 -> 2 ;\n2 -> 0 ;\n2 -> 1 ;\n}\n",
dot_str,
)
self.assertEqual("digraph {\n0 ;\n1 ;\n2 ;\n0 -> 1 ;\n0 -> 2 ;\n}\n", dot_str)

def test_digraph_graph_attrs(self):
graph = rustworkx.directed_gnp_random_graph(3, 0.9, seed=42)
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 ;\n0 -> 2 ;\n1 -> 2 ;\n2 -> 0 ;\n2 -> 1 ;\n}\n",
"digraph {\nbgcolor=red ;\n0 ;\n1 ;\n2 ;\n0 -> 1 ;\n" "0 -> 2 ;\n}\n",
dot_str,
)

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

0 comments on commit ac5541a

Please sign in to comment.