Otestována i druhá safe funkce (aspoň trošku)
This commit is contained in:
parent
8bdfa745e9
commit
14400a2465
1 changed files with 8 additions and 0 deletions
|
@ -25,8 +25,16 @@ class SimpleTreeLibTests(TestCase):
|
||||||
self.root.save()
|
self.root.save()
|
||||||
|
|
||||||
def test_safe_functions(self):
|
def test_safe_functions(self):
|
||||||
|
# safe_pred
|
||||||
self.assertEqual(tl.safe_pred(self.other_node), self.some_node)
|
self.assertEqual(tl.safe_pred(self.other_node), self.some_node)
|
||||||
self.assertIsNone(tl.safe_pred(self.root))
|
self.assertIsNone(tl.safe_pred(self.root))
|
||||||
self.assertIsNone(tl.safe_pred(self.some_node))
|
self.assertIsNone(tl.safe_pred(self.some_node))
|
||||||
self.assertIsNone(tl.safe_pred(self.some_orphan))
|
self.assertIsNone(tl.safe_pred(self.some_orphan))
|
||||||
self.assertIsNone(tl.safe_pred(self.other_orphan))
|
self.assertIsNone(tl.safe_pred(self.other_orphan))
|
||||||
|
|
||||||
|
# safe_father_of_first
|
||||||
|
self.assertIsNone(tl.safe_father_of_first(self.root))
|
||||||
|
self.assertEqual(tl.safe_father_of_first(self.some_node), self.root)
|
||||||
|
self.assertEqual(tl.safe_father_of_first(self.other_node), self.root)
|
||||||
|
self.assertIsNone(tl.safe_father_of_first(self.some_orphan))
|
||||||
|
self.assertEqual(tl.safe_father_of_first(self.other_orphan), self.some_orphan)
|
||||||
|
|
Loading…
Reference in a new issue