Skip to content

Commit

Permalink
Merge pull request #53 from galou/test_improvements
Browse files Browse the repository at this point in the history
Test improvements
  • Loading branch information
dirk-thomas committed Apr 30, 2015
2 parents efc7692 + 04f86e3 commit 10bf738
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 6 deletions.
4 changes: 3 additions & 1 deletion qt_dotgraph/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,6 @@ catkin_package()

catkin_python_setup()

catkin_add_nosetests(test)
if (CATKIN_ENABLE_TESTING)
catkin_add_nosetests(test)
endif()
2 changes: 2 additions & 0 deletions qt_dotgraph/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,6 @@

<run_depend>python-pydot</run_depend>
<run_depend>python_qt_binding</run_depend>

<test_depend>python-pygraphviz</test_depend>
</package>
19 changes: 14 additions & 5 deletions qt_dotgraph/test/pydot_factory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_add_node_escape_name(self):
self.assertEqual(1, len(g.get_nodes()))
self.assertEqual('graph_', g.get_nodes()[0].get_name())
self.assertEqual('graph_', g.get_nodes()[0].get_label())

def test_add_edge(self):
fac = PydotFactory()
g = fac.get_graph()
Expand Down Expand Up @@ -92,10 +92,19 @@ def test_create_dot(self):
fac.add_node_to_graph(g, 'edge')
fac.add_edge_to_graph(g, 'foo', 'edge')
fac.add_subgraph_to_graph(g, 'foo')
snippets = ['digraph graphname {\n\tgraph [rankdir=TB, rank=same];\n\tnode [label="\\N"];\n\tgraph [bb="', '"];\n\tsubgraph cluster_foo {\n\t\tgraph [',
'];\n\t}\n\tfoo [label=foo, shape=box, pos="',
'edge_ [label=edge_, shape=box, pos="',
'foo -> edge_',
snippets = ['digraph graphname {\n\tgraph [',
'rankdir=TB',
'compound=True',
'rank=same',
'node [label="\\N"]',
'subgraph cluster_foo {\n\t\tgraph [',
'foo\t [',
'label=foo',
'shape=box',
'pos="',
'edge_\t [',
'label=edge_',
'foo -> edge_\t [',
'"];\n}\n']
result = fac.create_dot(g)
for sn in snippets:
Expand Down

0 comments on commit 10bf738

Please sign in to comment.