From 14400a2465c3cd23026bc3c229f97ff9885ec6bf Mon Sep 17 00:00:00 2001 From: Pavel 'LEdoian' Turinsky Date: Thu, 30 Apr 2020 01:27:24 +0200 Subject: [PATCH] =?UTF-8?q?Otestov=C3=A1na=20i=20druh=C3=A1=20safe=20funkc?= =?UTF-8?q?e=20(aspo=C5=88=20tro=C5=A1ku)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- seminar/tests_treelib.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/seminar/tests_treelib.py b/seminar/tests_treelib.py index 9c67ca22..3245d0a6 100644 --- a/seminar/tests_treelib.py +++ b/seminar/tests_treelib.py @@ -25,8 +25,16 @@ class SimpleTreeLibTests(TestCase): self.root.save() def test_safe_functions(self): + # safe_pred self.assertEqual(tl.safe_pred(self.other_node), self.some_node) self.assertIsNone(tl.safe_pred(self.root)) self.assertIsNone(tl.safe_pred(self.some_node)) self.assertIsNone(tl.safe_pred(self.some_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)