-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.py
58 lines (54 loc) · 1.39 KB
/
tests.py
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import unittest
from main import Game
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
self.game = Game()
def test_process_line(self):
self.assertEqual(
Game.load_line(
[1,1,1,1,0,0,0,1,0,1,1,1,0,0]
),
(4,1,3)
)
self.assertEqual(
Game.load_line(
[0]*80 + [1]*7 + [0]*3 + [1]
),
(7,1)
)
self.assertEqual(
Game.load_line(
[1,0,1,0,1,0,1]
),
(1,1,1,1)
)
# def test_load_data_into_dataframe(self):
# self.assertEqual(
# [
# [True, False, True],
# [True, False, True],
# [False, True, False]
# ],
# )
# def test_something(self):
# self.assertEqual(True, False)
def test_loading_data(self):
testcase = [
[True, False, True],
[True, False, True],
[False, True, False],
[True, False, True],
]
self.game.load_from_list_of_lists(
testcase
)
self.assertEqual(
self.game.rows,
[(1, 1), (1, 1), (1,), (1, 1)]
)
self.assertEqual(
self.game.columns,
[(2, 1), (1,), (2, 1)]
)
if __name__ == '__main__':
unittest.main()