Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test improvements #53

Merged
merged 3 commits into from
Apr 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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