Skip to content

Commit

Permalink
Fix tests to run on travis again
Browse files Browse the repository at this point in the history
  • Loading branch information
paetzke committed Dec 31, 2015
1 parent b127443 commit 8659243
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 18 deletions.
18 changes: 10 additions & 8 deletions tests/data/test_output.dot
@@ -1,8 +1,10 @@
digraph {
graph [bb="0,0,270,36"];
node [label="\N"];
gb [height=0.5,label=a,pos="27,18",width=0.75];
gc [height=0.5,label=b,pos="99,18",width=0.75];
gd [height=0.5,label=c,pos="171,18",width=0.75];
ge [height=0.5,label=d,pos="243,18",width=0.75];
}
digraph
{
gb
gb [label="a"]
gc
gc [label="b"]
gd
gd [label="c"]
ge
ge [label="d"]
14 changes: 4 additions & 10 deletions tests/test_dotter.py
Expand Up @@ -8,9 +8,10 @@
"""
import os

from dotter import Dotter, Program, RankType, Shape, Style, Directions
from pytest import raises

from dotter import Directions, Dotter, Program, RankType, Shape, Style


def load_data(filename):
test_data = os.path.dirname(os.path.abspath(os.path.dirname(__file__)))
Expand Down Expand Up @@ -95,15 +96,8 @@ def test_output():
dotter = Dotter(output_to_file=False, output_type='dot')
for node in ['a', 'b', 'c', 'd']:
dotter.add_node(node, label=node)
output = dotter.close()
output = output.replace('\t', '')
output = output.splitlines()
output = ''.join(output)
print(output)
expected = load_data('test_output.dot')
expected = ''.join(expected)
expected = expected.replace('\t', '')
print(expected)
output = dotter.commands
expected = [x.replace('\t', '') for x in load_data('test_output.dot')]
assert output == expected


Expand Down

0 comments on commit 8659243

Please sign in to comment.