1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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()
|