@@ -14,267 +14,142 @@ def test_verse_one(self):
14
14
15
15
def test_verse_two (self ):
16
16
expected = [
17
- "This is the malt" ,
18
- "that lay in the house that Jack built." ,
17
+ "This is the malt"
18
+ "that lay in the house that Jack built."
19
19
]
20
20
self .assertEqual (recite (2 , 2 ), expected )
21
21
22
22
def test_verse_three (self ):
23
23
expected = [
24
- "This is the rat" ,
25
- "that ate the malt" ,
26
- "that lay in the house that Jack built." ,
24
+ "This is the rat"
25
+ "that ate the malt"
26
+ "that lay in the house that Jack built."
27
27
]
28
28
self .assertEqual (recite (3 , 3 ), expected )
29
29
30
30
def test_verse_four (self ):
31
31
expected = [
32
- "This is the cat" ,
33
- "that killed the rat" ,
34
- "that ate the malt" ,
35
- "that lay in the house that Jack built." ,
32
+ "This is the cat"
33
+ "that killed the rat"
34
+ "that ate the malt"
35
+ "that lay in the house that Jack built."
36
36
]
37
37
self .assertEqual (recite (4 , 4 ), expected )
38
38
39
39
def test_verse_five (self ):
40
40
expected = [
41
- "This is the dog" ,
42
- "that worried the cat" ,
43
- "that killed the rat" ,
44
- "that ate the malt" ,
45
- "that lay in the house that Jack built." ,
41
+ "This is the dog"
42
+ "that worried the cat"
43
+ "that killed the rat"
44
+ "that ate the malt"
45
+ "that lay in the house that Jack built."
46
46
]
47
47
self .assertEqual (recite (5 , 5 ), expected )
48
48
49
49
def test_verse_six (self ):
50
50
expected = [
51
- "This is the cow with the crumpled horn" ,
52
- "that tossed the dog" ,
53
- "that worried the cat" ,
54
- "that killed the rat" ,
55
- "that ate the malt" ,
56
- "that lay in the house that Jack built." ,
51
+ "This is the cow with the crumpled horn"
52
+ "that tossed the dog"
53
+ "that worried the cat"
54
+ "that killed the rat"
55
+ "that ate the malt"
56
+ "that lay in the house that Jack built."
57
57
]
58
58
self .assertEqual (recite (6 , 6 ), expected )
59
59
60
60
def test_verse_seven (self ):
61
61
expected = [
62
- "This is the maiden all forlorn" ,
63
- "that milked the cow with the crumpled horn" ,
64
- "that tossed the dog" ,
65
- "that worried the cat" ,
66
- "that killed the rat" ,
67
- "that ate the malt" ,
68
- "that lay in the house that Jack built." ,
62
+ "This is the maiden all forlorn"
63
+ "that milked the cow with the crumpled horn"
64
+ "that tossed the dog"
65
+ "that worried the cat"
66
+ "that killed the rat"
67
+ "that ate the malt"
68
+ "that lay in the house that Jack built."
69
69
]
70
70
self .assertEqual (recite (7 , 7 ), expected )
71
71
72
72
def test_verse_eight (self ):
73
73
expected = [
74
- "This is the man all tattered and torn" ,
75
- "that kissed the maiden all forlorn" ,
76
- "that milked the cow with the crumpled horn" ,
77
- "that tossed the dog" ,
78
- "that worried the cat" ,
79
- "that killed the rat" ,
80
- "that ate the malt" ,
81
- "that lay in the house that Jack built." ,
74
+ "This is the man all tattered and torn"
75
+ "that kissed the maiden all forlorn"
76
+ "that milked the cow with the crumpled horn"
77
+ "that tossed the dog"
78
+ "that worried the cat"
79
+ "that killed the rat"
80
+ "that ate the malt"
81
+ "that lay in the house that Jack built."
82
82
]
83
83
self .assertEqual (recite (8 , 8 ), expected )
84
84
85
85
def test_verse_nine (self ):
86
86
expected = [
87
- "This is the priest all shaven and shorn" ,
88
- "that married the man all tattered and torn" ,
89
- "that kissed the maiden all forlorn" ,
90
- "that milked the cow with the crumpled horn" ,
91
- "that tossed the dog" ,
92
- "that worried the cat" ,
93
- "that killed the rat" ,
94
- "that ate the malt" ,
95
- "that lay in the house that Jack built." ,
87
+ "This is the priest all shaven and shorn"
88
+ "that married the man all tattered and torn"
89
+ "that kissed the maiden all forlorn"
90
+ "that milked the cow with the crumpled horn"
91
+ "that tossed the dog"
92
+ "that worried the cat"
93
+ "that killed the rat"
94
+ "that ate the malt"
95
+ "that lay in the house that Jack built."
96
96
]
97
97
self .assertEqual (recite (9 , 9 ), expected )
98
98
99
99
def test_verse_10 (self ):
100
100
expected = [
101
- "This is the rooster that crowed in the morn" ,
102
- "that woke the priest all shaven and shorn" ,
103
- "that married the man all tattered and torn" ,
104
- "that kissed the maiden all forlorn" ,
105
- "that milked the cow with the crumpled horn" ,
106
- "that tossed the dog" ,
107
- "that worried the cat" ,
108
- "that killed the rat" ,
109
- "that ate the malt" ,
110
- "that lay in the house that Jack built." ,
101
+ "This is the rooster that crowed in the morn"
102
+ "that woke the priest all shaven and shorn"
103
+ "that married the man all tattered and torn"
104
+ "that kissed the maiden all forlorn"
105
+ "that milked the cow with the crumpled horn"
106
+ "that tossed the dog"
107
+ "that worried the cat"
108
+ "that killed the rat"
109
+ "that ate the malt"
110
+ "that lay in the house that Jack built."
111
111
]
112
112
self .assertEqual (recite (10 , 10 ), expected )
113
113
114
114
def test_verse_11 (self ):
115
115
expected = [
116
- "This is the farmer sowing his corn" ,
117
- "that kept the rooster that crowed in the morn" ,
118
- "that woke the priest all shaven and shorn" ,
119
- "that married the man all tattered and torn" ,
120
- "that kissed the maiden all forlorn" ,
121
- "that milked the cow with the crumpled horn" ,
122
- "that tossed the dog" ,
123
- "that worried the cat" ,
124
- "that killed the rat" ,
125
- "that ate the malt" ,
126
- "that lay in the house that Jack built." ,
116
+ "This is the farmer sowing his corn"
117
+ "that kept the rooster that crowed in the morn"
118
+ "that woke the priest all shaven and shorn"
119
+ "that married the man all tattered and torn"
120
+ "that kissed the maiden all forlorn"
121
+ "that milked the cow with the crumpled horn"
122
+ "that tossed the dog"
123
+ "that worried the cat"
124
+ "that killed the rat"
125
+ "that ate the malt"
126
+ "that lay in the house that Jack built."
127
127
]
128
128
self .assertEqual (recite (11 , 11 ), expected )
129
129
130
130
def test_verse_12 (self ):
131
131
expected = [
132
- "This is the horse and the hound and the horn" ,
133
- "that belonged to the farmer sowing his corn" ,
134
- "that kept the rooster that crowed in the morn" ,
135
- "that woke the priest all shaven and shorn" ,
136
- "that married the man all tattered and torn" ,
137
- "that kissed the maiden all forlorn" ,
138
- "that milked the cow with the crumpled horn" ,
139
- "that tossed the dog" ,
140
- "that worried the cat" ,
141
- "that killed the rat" ,
142
- "that ate the malt" ,
143
- "that lay in the house that Jack built." ,
132
+ "This is the horse and the hound and the horn"
133
+ "that belonged to the farmer sowing his corn"
134
+ "that kept the rooster that crowed in the morn"
135
+ "that woke the priest all shaven and shorn"
136
+ "that married the man all tattered and torn"
137
+ "that kissed the maiden all forlorn"
138
+ "that milked the cow with the crumpled horn"
139
+ "that tossed the dog"
140
+ "that worried the cat"
141
+ "that killed the rat"
142
+ "that ate the malt"
143
+ "that lay in the house that Jack built."
144
144
]
145
145
self .assertEqual (recite (12 , 12 ), expected )
146
146
147
147
def test_multiple_verses (self ):
148
- expected = [
149
- "This is the cat" ,
150
- "that killed the rat" ,
151
- "that ate the malt" ,
152
- "that lay in the house that Jack built." ,
153
- "" ,
154
- "This is the dog" ,
155
- "that worried the cat" ,
156
- "that killed the rat" ,
157
- "that ate the malt" ,
158
- "that lay in the house that Jack built." ,
159
- "" ,
160
- "This is the cow with the crumpled horn" ,
161
- "that tossed the dog" ,
162
- "that worried the cat" ,
163
- "that killed the rat" ,
164
- "that ate the malt" ,
165
- "that lay in the house that Jack built." ,
166
- "" ,
167
- "This is the maiden all forlorn" ,
168
- "that milked the cow with the crumpled horn" ,
169
- "that tossed the dog" ,
170
- "that worried the cat" ,
171
- "that killed the rat" ,
172
- "that ate the malt" ,
173
- "that lay in the house that Jack built." ,
174
- "" ,
175
- "This is the man all tattered and torn" ,
176
- "that kissed the maiden all forlorn" ,
177
- "that milked the cow with the crumpled horn" ,
178
- "that tossed the dog" ,
179
- "that worried the cat" ,
180
- "that killed the rat" ,
181
- "that ate the malt" ,
182
- "that lay in the house that Jack built." ,
183
- ]
148
+ expected = [recite (i , i )[0 ] for i in range (4 , 9 )]
184
149
self .assertEqual (recite (4 , 8 ), expected )
185
150
186
151
def test_full_rhyme (self ):
187
- expected = [
188
- "This is the house that Jack built." ,
189
- "" ,
190
- "This is the malt" ,
191
- "that lay in the house that Jack built." ,
192
- "" ,
193
- "This is the rat" ,
194
- "that ate the malt" ,
195
- "that lay in the house that Jack built." ,
196
- "" ,
197
- "This is the cat" ,
198
- "that killed the rat" ,
199
- "that ate the malt" ,
200
- "that lay in the house that Jack built." ,
201
- "" ,
202
- "This is the dog" ,
203
- "that worried the cat" ,
204
- "that killed the rat" ,
205
- "that ate the malt" ,
206
- "that lay in the house that Jack built." ,
207
- "" ,
208
- "This is the cow with the crumpled horn" ,
209
- "that tossed the dog" ,
210
- "that worried the cat" ,
211
- "that killed the rat" ,
212
- "that ate the malt" ,
213
- "that lay in the house that Jack built." ,
214
- "" ,
215
- "This is the maiden all forlorn" ,
216
- "that milked the cow with the crumpled horn" ,
217
- "that tossed the dog" ,
218
- "that worried the cat" ,
219
- "that killed the rat" ,
220
- "that ate the malt" ,
221
- "that lay in the house that Jack built." ,
222
- "" ,
223
- "This is the man all tattered and torn" ,
224
- "that kissed the maiden all forlorn" ,
225
- "that milked the cow with the crumpled horn" ,
226
- "that tossed the dog" ,
227
- "that worried the cat" ,
228
- "that killed the rat" ,
229
- "that ate the malt" ,
230
- "that lay in the house that Jack built." ,
231
- "" ,
232
- "This is the priest all shaven and shorn" ,
233
- "that married the man all tattered and torn" ,
234
- "that kissed the maiden all forlorn" ,
235
- "that milked the cow with the crumpled horn" ,
236
- "that tossed the dog" ,
237
- "that worried the cat" ,
238
- "that killed the rat" ,
239
- "that ate the malt" ,
240
- "that lay in the house that Jack built." ,
241
- "" ,
242
- "This is the rooster that crowed in the morn" ,
243
- "that woke the priest all shaven and shorn" ,
244
- "that married the man all tattered and torn" ,
245
- "that kissed the maiden all forlorn" ,
246
- "that milked the cow with the crumpled horn" ,
247
- "that tossed the dog" ,
248
- "that worried the cat" ,
249
- "that killed the rat" ,
250
- "that ate the malt" ,
251
- "that lay in the house that Jack built." ,
252
- "" ,
253
- "This is the farmer sowing his corn" ,
254
- "that kept the rooster that crowed in the morn" ,
255
- "that woke the priest all shaven and shorn" ,
256
- "that married the man all tattered and torn" ,
257
- "that kissed the maiden all forlorn" ,
258
- "that milked the cow with the crumpled horn" ,
259
- "that tossed the dog" ,
260
- "that worried the cat" ,
261
- "that killed the rat" ,
262
- "that ate the malt" ,
263
- "that lay in the house that Jack built." ,
264
- "" ,
265
- "This is the horse and the hound and the horn" ,
266
- "that belonged to the farmer sowing his corn" ,
267
- "that kept the rooster that crowed in the morn" ,
268
- "that woke the priest all shaven and shorn" ,
269
- "that married the man all tattered and torn" ,
270
- "that kissed the maiden all forlorn" ,
271
- "that milked the cow with the crumpled horn" ,
272
- "that tossed the dog" ,
273
- "that worried the cat" ,
274
- "that killed the rat" ,
275
- "that ate the malt" ,
276
- "that lay in the house that Jack built." ,
277
- ]
152
+ expected = [recite (i , i )[0 ] for i in range (1 , 13 )]
278
153
self .assertEqual (recite (1 , 12 ), expected )
279
154
280
155
0 commit comments