-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.py
150 lines (119 loc) · 4.11 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
import unittest
from book_print_settings import book_print_settings
class TestPrintPages(unittest.TestCase):
def test_negative_2(self):
res = book_print_settings(-2, 2)
self.assertEqual(res, 'Error')
return
def test_0_1(self):
res = book_print_settings(0, 1)
self.assertEqual(res, [])
return
def test_2_negative(self):
res = book_print_settings(2, -2)
self.assertEqual(res, 'Error')
return
def test_1_0(self):
res = book_print_settings(1, 0)
self.assertEqual(res, [])
return
def test_1_1(self):
res = book_print_settings(1, 1)
self.assertEqual(res, [(0, 1)])
return
def test_2_1(self):
res = book_print_settings(2, 1)
self.assertEqual(res, [(0, 1), '@', (2, 0)])
return
def test_3_1(self):
res = book_print_settings(3, 1)
self.assertEqual(res, [(0, 1), '@', (2, 3)])
return
def test_4_1(self):
res = book_print_settings(4, 1)
self.assertEqual(res, [(4, 1), '@', (2, 3)])
return
def test_5_1(self):
res = book_print_settings(5, 1)
self.assertEqual(res, [(0, 1), (0, 3), '@', (2, 0), (4, 5)])
return
def test_6_1(self):
res = book_print_settings(6, 1)
self.assertEqual(res, [(0, 1), (6, 3), '@', (2, 0), (4, 5)])
return
def test_7_1(self):
res = book_print_settings(7, 1)
self.assertEqual(res, [(0, 1), (6, 3), '@', (2, 7), (4, 5)])
return
def test_8_1(self):
res = book_print_settings(8, 1)
self.assertEqual(res, [(8, 1), (6, 3), '@', (2, 7), (4, 5)])
return
def test_11_1(self):
res = book_print_settings(11, 1)
self.assertEqual(res, [(0, 1), (10, 3), (8, 5), '@', (2, 11), (4, 9), (6, 7)])
return
def test_12_1(self):
res = book_print_settings(12, 1)
self.assertEqual(res, [(12, 1), (10, 3), (8, 5), '@', (2, 11), (4, 9), (6, 7)])
return
#
def test_1_2(self):
res = book_print_settings(1, 2)
self.assertEqual(res, "Error")
return
def test_2_4(self):
res = book_print_settings(2, 4)
self.assertEqual(res, "Error")
return
def test_3_2(self):
res = book_print_settings(3, 2)
self.assertEqual(res, "Error")
return
def test_4_6(self):
res = book_print_settings(4, 6)
self.assertEqual(res, "Error")
return
def test_5_2(self):
res = book_print_settings(5, 2)
self.assertEqual(res, [(4, 1), '@', (2, 3), '#', (0, 5)])
return
def test_6_2(self):
res = book_print_settings(6, 2)
self.assertEqual(res, [(4, 1), '@', (2, 3), '#', (0, 5), '@', (6, 0)])
return
def test_7_2(self):
res = book_print_settings(7, 2)
self.assertEqual(res, [(4, 1), '@', (2, 3), '#', (0, 5), '@', (6, 7)])
return
def test_8_2(self):
res = book_print_settings(8, 2)
self.assertEqual(res, [(4, 1), '@', (2, 3), '#', (8, 5), '@', (6, 7)])
return
def test_11_2(self):
res = book_print_settings(11, 2)
self.assertEqual(res, [(8, 1), (6, 3), '@', (2, 7), (4, 5), '#', (0, 9), '@', (10, 11)])
return
def test_11_3(self):
res = book_print_settings(11, 3)
self.assertEqual(res, [(4, 1), '@', (2, 3), '#',
(8, 5), '@', (6, 7), '#',
(0, 9), '@', (10, 11)])
return
def test_17_4(self):
res = book_print_settings(17, 4)
self.assertEqual(res, [(8, 1), (6, 3), '@', (2, 7), (4, 5), '#',
(12, 9), '@', (10, 11), '#',
(16, 13), '@', (14, 15), '#',
(0, 17)])
return
def test_17_6(self):
res = book_print_settings(17, 6)
self.assertEqual(res, "Error")
return
def test_7(self):
res = book_print_settings(7)
self.assertEqual(res, [(0, 1), (6, 3), '@', (2, 7), (4, 5)])
return
if __name__ == '__main__':
unittest.main()