-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhall_test.py
35 lines (27 loc) · 1.23 KB
/
hall_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
import unittest
from hall import Hall
class HallTest(unittest.TestCase):
def setUp(self):
self.hall = Hall()
def test_new_instance(self):
self.assertTrue(self.hall, Hall)
def test_valid_members(self):
places = [
[' ', '1', '2', '3', '4', '5', '6', '7', '8', '9', '10'],
['1 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['2 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['3 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['4 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['5 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['6 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['7 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['8 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['9 ', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.'],
['10', '.', '.', '.', '.', '.', '.', '.', '.', '.', '.']
]
self.assertEqual(self.hall.places, places)
def test_set_busy_seat(self):
self.hall.set_busy_seat(5, 5)
self.assertEqual(self.hall.places[5][5], 'X')
if __name__ == '__main__':
unittest.main()