Code cleanup and marked error handling as 'no coverage'.

parent 7e891018
......@@ -68,23 +68,6 @@ def generate_graph(root, node_type, separator=' ', verbose=False):
return width
def node_middle(node):
node_len = len(node)
node_mid = int(node_len / 2)
#if node_len % 2 == 1:
# node_mid += 1
middle = 0
for i, child in enumerate(node):
if i == node_mid:
break
middle += node_width[child]
return middle + max(0, separator_len * (node_mid - 1))
def format_lines(node):
if not isinstance(node, node_type):
# Leaf titles do not need to be centered, since the parent will
......@@ -185,7 +168,7 @@ def generate_graph(root, node_type, separator=' ', verbose=False):
try:
assert len(title_line) == len(edge_line)
except AssertionError:
except AssertionError: # pragma: nocover
print '------------------'
print 'line_width:', line_width
print 'title_line:', title_line, 'len:', len(title_line)
......
......@@ -83,7 +83,7 @@ class TestGraph(unittest.TestCase):
def assertEqualGraphs(self, g, expect):
expect = self.strip(expect)
if g != expect:
if g != expect: # pragma: nocover
print 'Expected:'
print expect
print 'Got:'
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment