-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.py
83 lines (74 loc) · 2.07 KB
/
test.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
from maze.objects import Maze
import unittest
class Tests(unittest.TestCase):
def test_maze_create_cells(self):
num_cols = 12
num_rows = 10
m1 = Maze(0, 0, num_rows, num_cols, 10, 10)
self.assertEqual(
len(m1._cells),
num_cols,
)
self.assertEqual(
len(m1._cells[0]),
num_rows,
)
# def test_open_maze(self):
# num_cols = 12
# num_rows = 10
# m1 = Maze(0, 0, num_rows, num_cols, 10, 10)
# m1._open_maze()
# self.assertEqual(
# m1._cells[0][0].top_wall, False
# )
# self.assertEqual(
# m1._cells[9][11].bottom_wall, False
# )
# def test_maze_create_cells_2(self):
# num_cols = 1
# num_rows = 1
# m1 = Maze(0, 0, num_rows, num_cols, 10, 10)
# self.assertEqual(
# len(m1._cells[0]),
# num_cols,
# )
# self.assertEqual(
# len(m1._cells),
# num_rows,
# )
# def test_open_maze2(self):
# num_cols = 1
# num_rows = 1
# m1 = Maze(0, 0, num_rows, num_cols, 10, 10)
# m1._open_maze()
# self.assertEqual(
# m1._cells[0][0].top_wall, False
# )
# self.assertEqual(
# m1._cells[0][0].bottom_wall, False
# )
# def test_maze_create_cells_3(self):
# num_cols = 15
# num_rows = 10
# m1 = Maze(0, 0, num_rows, num_cols, 10, 10)
# self.assertEqual(
# len(m1._cells[0]),
# num_cols,
# )
# self.assertEqual(
# len(m1._cells),
# num_rows,
# )
# def test_open_maze3(self):
# num_cols = 15
# num_rows = 10
# m1 = Maze(0, 0, num_rows, num_cols, 10, 10)
# m1._open_maze()
# self.assertEqual(
# m1._cells[0][0].top_wall, False
# )
# self.assertEqual(
# m1._cells[14][9].bottom_wall, False
# )
if __name__ == "__main__":
unittest.main()