Skip to content

Commit

Permalink
TST: update to API change that graph_from_dot_data always returns `…
Browse files Browse the repository at this point in the history
…list`
  • Loading branch information
johnyf committed Jul 2, 2016
1 parent f8d2b5e commit 66734d2
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions test/pydot_unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def test_create_simple_graph_with_node(self):
def test_attribute_with_implicit_value(self):

d='digraph {\na -> b[label="hi", decorate];\n}'
g = pydot.graph_from_dot_data(d)
graphs = pydot.graph_from_dot_data(d)
(g,) = graphs
attrs = g.get_edges()[0].get_attributes()

self.assertEqual( 'decorate' in attrs, True )
Expand Down Expand Up @@ -128,9 +129,8 @@ def test_unicode_ids(self):

self.assertEqual( g.get_edges()[0].get_source(), node1 )
self.assertEqual( g.get_edges()[0].get_destination(), node2 )

#g2 = dot_parser.parse_dot_data( g.to_string() )
g2 = pydot.graph_from_dot_data( g.to_string() )
graphs = pydot.graph_from_dot_data(g.to_string())
(g2,) = graphs

self.assertEqual( g2.get_node(node1)[0].get_name(), node1 )
self.assertEqual( g2.get_node(node2)[0].get_name(), node2 )
Expand All @@ -157,8 +157,8 @@ def test_graph_with_shapefiles(self):
f.close()

#g = dot_parser.parse_dot_data(graph_data)
g = pydot.graph_from_dot_data(graph_data)

graphs = pydot.graph_from_dot_data(graph_data)
(g,) = graphs
g.set_shape_files( pngs )

jpe_data = g.create( format='jpe' )
Expand Down Expand Up @@ -208,12 +208,12 @@ def _render_with_graphviz(self, filename):


def _render_with_pydot(self, filename):
g = pydot.graph_from_dot_file(filename)
if not isinstance(g, list):
g = [g]
jpe_data = ''.join([_g.create(format='jpe') for _g in g])
return sha256(jpe_data).hexdigest()

c = pydot.graph_from_dot_file(filename)
sha = ''
for g in c:
jpe_data = g.create(format='jpe')
sha += sha256(jpe_data).hexdigest()
return sha

def test_my_regression_tests(self):

Expand Down

0 comments on commit 66734d2

Please sign in to comment.