Skip to content

Commit

Permalink
Fix coverage gap.
Browse files Browse the repository at this point in the history
  • Loading branch information
c0fec0de committed Nov 8, 2017
1 parent c61ebfe commit 222827a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tests/test_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,12 +179,19 @@ def test_children_setter_large():
eq_(root.descendants, (s0, s0a, s0b, s1, s1a, s1b, s1c))


def test_type_assertion():
def test_node_children_type():

root = Node("root")
with assert_raises(TreeError, "Cannot add non-node object 'string'. It is not a subclass of 'NodeMixin'."):
root.children = ["string"]

def test_node_children_multiple():

root = Node("root")
sub = Node("sub")
with assert_raises(TreeError, "Cannot add node Node('/sub') multiple times as child."):
root.children = [sub, sub]


def test_recursion_detection():
"""Recursion detection."""
Expand Down

0 comments on commit 222827a

Please sign in to comment.