diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/tree_height.py | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/tree_height.py b/tests/tree_height.py new file mode 100644 index 0000000..75a1382 --- /dev/null +++ b/tests/tree_height.py @@ -0,0 +1,36 @@ +import unittest + +from sources.tree_height import get_height + +class MyTestCase(unittest.TestCase): + def test1(self): + a = [4, -1, 4, 1, 1] + self.assertEqual(3, get_height(a)) + + def test2(self): + a = [-1, 0, 4, 0, 3] + self.assertEqual(4, get_height(a)) + + # def test3(self): + # a = [4, -1, 4, 1, 1] + # self.assertEqual(3, getHeightNaive(a)) + # + # def test4(self): + # a = [-1, 0, 4, 0, 3] + # self.assertEqual(4, getHeightNaive(a)) + # + # def test5(self): + # a = [9, 7, 5, 5, 2, 9, 9, 9, 2, -1] + # self.assertEqual(4, getHeightNaive(a)) + + def test6(self): + a = [9, 7, 5, 5, 2, 9, 9, 9, 2, -1] + self.assertEqual(4, get_height(a)) + + def test7(self): + a = [8, 8, 5, 6, 7, 3, 1, 6, -1, 5] + self.assertEqual(6, get_height(a)) + + +if __name__ == '__main__': + unittest.main() |