43 self.assertEquals(
'same', g.get_rank())
44 self.assertEquals(
'digraph', g.get_graph_type())
49 fac.add_node_to_graph(g,
'foo')
50 self.assertEqual(1, len(g.get_nodes()))
51 self.assertEqual(
'foo', g.get_nodes()[0].get_name())
52 self.assertEqual(
'foo', g.get_nodes()[0].get_label())
57 fac.add_node_to_graph(g,
'graph')
58 self.assertEqual(1, len(g.get_nodes()))
59 self.assertEqual(
'graph_', g.get_nodes()[0].get_name())
60 self.assertEqual(
'graph_', g.get_nodes()[0].get_label())
65 fac.add_node_to_graph(g,
'foo')
66 fac.add_node_to_graph(g,
'bar')
67 fac.add_edge_to_graph(g,
'foo',
'bar')
68 self.assertEqual(2, len(g.get_nodes()))
69 self.assertEqual(1, len(g.get_edges()))
70 self.assertEqual(
'foo', g.get_edges()[0].get_source())
71 self.assertEqual(
'bar', g.get_edges()[0].get_destination())
76 fac.add_subgraph_to_graph(g,
'foo')
77 self.assertEqual(1, len(g.get_subgraph_list()))
78 self.assertEqual(
'cluster_foo', g.get_subgraph_list()[0].get_name())
79 self.assertEqual(
'foo', g.get_subgraph_list()[0].get_label())
84 fac.add_subgraph_to_graph(g,
'graph')
85 self.assertEqual(1, len(g.get_subgraph_list()))
86 self.assertEqual(
'cluster_graph_', g.get_subgraph_list()[0].get_name())
87 self.assertEqual(
'graph_', g.get_subgraph_list()[0].get_label())
92 fac.add_node_to_graph(g,
'foo')
93 fac.add_node_to_graph(g,
'edge')
94 fac.add_edge_to_graph(g,
'foo',
'edge')
95 fac.add_subgraph_to_graph(g,
'foo')
96 snippets = [
'digraph graphname {\n\tgraph [',
100 'node [label="\\N"]',
101 'subgraph cluster_foo {\n\t\tgraph [',
110 result = fac.create_dot(g)
112 self.assertTrue(sn
in result,
'%s \nmissing in\n %s' % (sn, result))
def test_add_subgraph_escape_name(self)
def test_add_node_escape_name(self)
def test_add_subgraph(self)
def test_create_dot(self)