30
30
31
31
# pylint: enable=wrong-import-position
32
32
33
-
34
- class Test_MIDIMessage_from_message_byte_tests (
35
- unittest . TestCase
36
- ): # pylint: disable=invalid-name
37
- def test_NoteOn_basic ( self ):
33
+ # pylint: disable=invalid-name
34
+ class Test_MIDIMessage_from_message_byte_tests (unittest . TestCase ):
35
+ # pylint: enable=invalid-name
36
+ def test_NoteOn_basic ( self ): # pylint: disable=invalid-name
37
+ # pylint: enable=invalid-name
38
38
data = bytes ([0x90 , 0x30 , 0x7F ])
39
39
ichannel = 0
40
40
@@ -49,7 +49,8 @@ def test_NoteOn_basic(self):
49
49
self .assertEqual (skipped , 0 )
50
50
self .assertEqual (msg .channel , 0 )
51
51
52
- def test_NoteOn_awaitingthirdbyte (self ):
52
+ def test_NoteOn_awaitingthirdbyte (self ): # pylint: disable=invalid-name
53
+ # pylint: enable=invalid-name
53
54
data = bytes ([0x90 , 0x30 ])
54
55
ichannel = 0
55
56
@@ -69,7 +70,8 @@ def test_NoteOn_awaitingthirdbyte(self):
69
70
)
70
71
self .assertEqual (skipped , 0 )
71
72
72
- def test_NoteOn_predatajunk (self ):
73
+ def test_NoteOn_predatajunk (self ): # pylint: disable=invalid-name
74
+ # pylint: enable=invalid-name
73
75
data = bytes ([0x20 , 0x64 , 0x90 , 0x30 , 0x32 ])
74
76
ichannel = 0
75
77
@@ -88,7 +90,8 @@ def test_NoteOn_predatajunk(self):
88
90
self .assertEqual (skipped , 2 )
89
91
self .assertEqual (msg .channel , 0 )
90
92
91
- def test_NoteOn_prepartialsysex (self ):
93
+ def test_NoteOn_prepartialsysex (self ): # pylint: disable=invalid-name
94
+ # pylint: enable=invalid-name
92
95
data = bytes ([0x01 , 0x02 , 0x03 , 0x04 , 0xF7 , 0x90 , 0x30 , 0x32 ])
93
96
ichannel = 0
94
97
@@ -124,7 +127,8 @@ def test_NoteOn_prepartialsysex(self):
124
127
self .assertEqual (skipped , 0 )
125
128
self .assertEqual (msg .channel , 0 )
126
129
127
- def test_NoteOn_postNoteOn (self ):
130
+ def test_NoteOn_postNoteOn (self ): # pylint: disable=invalid-name
131
+ # pylint: enable=invalid-name
128
132
data = bytes ([0x90 | 0x08 , 0x30 , 0x7F , 0x90 | 0x08 , 0x37 , 0x64 ])
129
133
ichannel = 8
130
134
@@ -139,7 +143,8 @@ def test_NoteOn_postNoteOn(self):
139
143
self .assertEqual (skipped , 0 )
140
144
self .assertEqual (msg .channel , 8 )
141
145
142
- def test_NoteOn_postpartialNoteOn (self ):
146
+ def test_NoteOn_postpartialNoteOn (self ): # pylint: disable=invalid-name
147
+ # pylint: enable=invalid-name
143
148
data = bytes ([0x90 , 0x30 , 0x7F , 0x90 , 0x37 ])
144
149
ichannel = 0
145
150
@@ -154,7 +159,8 @@ def test_NoteOn_postpartialNoteOn(self):
154
159
self .assertEqual (skipped , 0 )
155
160
self .assertEqual (msg .channel , 0 )
156
161
157
- def test_NoteOn_preotherchannel (self ):
162
+ def test_NoteOn_preotherchannel (self ): # pylint: disable=invalid-name
163
+ # pylint: enable=invalid-name
158
164
data = bytes ([0x90 | 0x05 , 0x30 , 0x7F , 0x90 | 0x03 , 0x37 , 0x64 ])
159
165
ichannel = 3
160
166
@@ -169,7 +175,10 @@ def test_NoteOn_preotherchannel(self):
169
175
self .assertEqual (skipped , 0 )
170
176
self .assertEqual (msg .channel , 3 )
171
177
172
- def test_NoteOn_preotherchannelplusintermediatejunk (self ):
178
+ def test_NoteOn_preotherchannelplusintermediatejunk (
179
+ self ,
180
+ ): # pylint: disable=invalid-name
181
+ # pylint: enable=invalid-name
173
182
data = bytes ([0x90 | 0x05 , 0x30 , 0x7F , 0x00 , 0x00 , 0x90 | 0x03 , 0x37 , 0x64 ])
174
183
ichannel = 3
175
184
@@ -186,7 +195,8 @@ def test_NoteOn_preotherchannelplusintermediatejunk(self):
186
195
self .assertEqual (skipped , 0 )
187
196
self .assertEqual (msg .channel , 3 )
188
197
189
- def test_NoteOn_wrongchannel (self ):
198
+ def test_NoteOn_wrongchannel (self ): # pylint: disable=invalid-name
199
+ # pylint: enable=invalid-name
190
200
data = bytes ([0x95 , 0x30 , 0x7F ])
191
201
ichannel = 3
192
202
@@ -198,7 +208,8 @@ def test_NoteOn_wrongchannel(self):
198
208
self .assertEqual (msgendidxplusone , 3 , "wrong channel message discarded" )
199
209
self .assertEqual (skipped , 0 )
200
210
201
- def test_NoteOn_partialandpreotherchannel1 (self ):
211
+ def test_NoteOn_partialandpreotherchannel1 (self ): # pylint: disable=invalid-name
212
+ # pylint: enable=invalid-name
202
213
data = bytes ([0x95 , 0x30 , 0x7F , 0x93 ])
203
214
ichannel = 3
204
215
@@ -212,7 +223,8 @@ def test_NoteOn_partialandpreotherchannel1(self):
212
223
)
213
224
self .assertEqual (skipped , 0 )
214
225
215
- def test_NoteOn_partialandpreotherchannel2 (self ):
226
+ def test_NoteOn_partialandpreotherchannel2 (self ): # pylint: disable=invalid-name
227
+ # pylint: enable=invalid-name
216
228
data = bytes ([0x95 , 0x30 , 0x7F , 0x93 , 0x37 ])
217
229
ichannel = 3
218
230
@@ -226,7 +238,8 @@ def test_NoteOn_partialandpreotherchannel2(self):
226
238
)
227
239
self .assertEqual (skipped , 0 )
228
240
229
- def test_NoteOn_constructor_int (self ):
241
+ def test_NoteOn_constructor_int (self ): # pylint: disable=invalid-name
242
+ # pylint: enable=invalid-name
230
243
object1 = NoteOn (60 , 0x7F )
231
244
232
245
self .assertEqual (object1 .note , 60 )
@@ -251,7 +264,8 @@ def test_NoteOn_constructor_int(self):
251
264
self .assertEqual (object4 .velocity , 127 )
252
265
self .assertIsNone (object4 .channel )
253
266
254
- def test_SystemExclusive_NoteOn (self ):
267
+ def test_SystemExclusive_NoteOn (self ): # pylint: disable=invalid-name
268
+ # pylint: enable=invalid-name
255
269
data = bytes ([0xF0 , 0x42 , 0x01 , 0x02 , 0x03 , 0x04 , 0xF7 , 0x90 | 14 , 0x30 , 0x60 ])
256
270
ichannel = 14
257
271
@@ -279,7 +293,10 @@ def test_SystemExclusive_NoteOn(self):
279
293
self .assertEqual (skipped , 0 )
280
294
self .assertEqual (msg .channel , 14 )
281
295
282
- def test_SystemExclusive_NoteOn_premalterminatedsysex (self ):
296
+ def test_SystemExclusive_NoteOn_premalterminatedsysex (
297
+ self ,
298
+ ): # pylint: disable=invalid-name
299
+ # pylint: enable=invalid-name
283
300
data = bytes ([0xF0 , 0x42 , 0x01 , 0x02 , 0x03 , 0x04 , 0xF0 , 0x90 , 0x30 , 0x32 ])
284
301
ichannel = 0
285
302
@@ -294,7 +311,8 @@ def test_SystemExclusive_NoteOn_premalterminatedsysex(self):
294
311
skipped , 0 , "If SystemExclusive class is imported then this must be 0"
295
312
)
296
313
297
- def test_Unknown_SinglebyteStatus (self ):
314
+ def test_Unknown_SinglebyteStatus (self ): # pylint: disable=invalid-name
315
+ # pylint: enable=invalid-name
298
316
data = bytes ([0xFD ])
299
317
ichannel = 0
300
318
@@ -307,7 +325,8 @@ def test_Unknown_SinglebyteStatus(self):
307
325
self .assertEqual (skipped , 0 )
308
326
self .assertIsNone (msg .channel )
309
327
310
- def test_Empty (self ):
328
+ def test_Empty (self ): # pylint: disable=invalid-name
329
+ # pylint: enable=invalid-name
311
330
data = bytes ([])
312
331
ichannel = 0
313
332
@@ -323,7 +342,8 @@ def test_Empty(self):
323
342
class Test_MIDIMessage_NoteOn_constructor (
324
343
unittest .TestCase
325
344
): # pylint: disable=invalid-name
326
- def test_NoteOn_constructor_string (self ):
345
+ def test_NoteOn_constructor_string (self ): # pylint: disable=invalid-name
346
+ # pylint: enable=invalid-name
327
347
object1 = NoteOn ("C4" , 0x64 )
328
348
self .assertEqual (object1 .note , 60 )
329
349
self .assertEqual (object1 .velocity , 0x64 )
@@ -336,28 +356,29 @@ def test_NoteOn_constructor_string(self):
336
356
self .assertEqual (object3 .note , 61 )
337
357
self .assertEqual (object3 .velocity , 0 )
338
358
339
- def test_NoteOn_constructor_valueerror1 (self ):
359
+ def test_NoteOn_constructor_valueerror1 (self ): # pylint: disable=invalid-name
340
360
with self .assertRaises (ValueError ):
341
361
NoteOn (60 , 0x80 ) # pylint is happier if return value not stored
342
362
343
- def test_NoteOn_constructor_valueerror2 (self ):
363
+ def test_NoteOn_constructor_valueerror2 (self ): # pylint: disable=invalid-name
344
364
with self .assertRaises (ValueError ):
345
365
NoteOn (- 1 , 0x7F )
346
366
347
- def test_NoteOn_constructor_valueerror3 (self ):
367
+ def test_NoteOn_constructor_valueerror3 (self ): # pylint: disable=invalid-name
348
368
with self .assertRaises (ValueError ):
349
369
NoteOn (128 , 0x7F )
350
370
351
- def test_NoteOn_constructor_upperrange1 (self ):
371
+ def test_NoteOn_constructor_upperrange1 (self ): # pylint: disable=invalid-name
372
+ # pylint: enable=invalid-name
352
373
object1 = NoteOn ("G9" , 0x7F )
353
374
self .assertEqual (object1 .note , 127 )
354
375
self .assertEqual (object1 .velocity , 0x7F )
355
376
356
- def test_NoteOn_constructor_upperrange2 (self ):
377
+ def test_NoteOn_constructor_upperrange2 (self ): # pylint: disable=invalid-name
357
378
with self .assertRaises (ValueError ):
358
379
NoteOn ("G#9" , 0x7F ) # just above max note
359
380
360
- def test_NoteOn_constructor_bogusstring (self ):
381
+ def test_NoteOn_constructor_bogusstring (self ): # pylint: disable=invalid-name
361
382
with self .assertRaises (ValueError ):
362
383
NoteOn ("CC4" , 0x7F )
363
384
@@ -366,7 +387,8 @@ class Test_MIDIMessage_NoteOff_constructor(
366
387
unittest .TestCase
367
388
): # pylint: disable=invalid-name
368
389
# mostly cut and paste from NoteOn above
369
- def test_NoteOff_constructor_string (self ):
390
+ def test_NoteOff_constructor_string (self ): # pylint: disable=invalid-name
391
+ # pylint: enable=invalid-name
370
392
object1 = NoteOff ("C4" , 0x64 )
371
393
self .assertEqual (object1 .note , 60 )
372
394
self .assertEqual (object1 .velocity , 0x64 )
@@ -383,28 +405,29 @@ def test_NoteOff_constructor_string(self):
383
405
self .assertEqual (object4 .note , 61 )
384
406
self .assertEqual (object4 .velocity , 0 )
385
407
386
- def test_NoteOff_constructor_valueerror1 (self ):
408
+ def test_NoteOff_constructor_valueerror1 (self ): # pylint: disable=invalid-name
387
409
with self .assertRaises (ValueError ):
388
410
NoteOff (60 , 0x80 )
389
411
390
- def test_NoteOff_constructor_valueerror2 (self ):
412
+ def test_NoteOff_constructor_valueerror2 (self ): # pylint: disable=invalid-name
391
413
with self .assertRaises (ValueError ):
392
414
NoteOff (- 1 , 0x7F )
393
415
394
- def test_NoteOff_constructor_valueerror3 (self ):
416
+ def test_NoteOff_constructor_valueerror3 (self ): # pylint: disable=invalid-name
395
417
with self .assertRaises (ValueError ):
396
418
NoteOff (128 , 0x7F )
397
419
398
- def test_NoteOff_constructor_upperrange1 (self ):
420
+ def test_NoteOff_constructor_upperrange1 (self ): # pylint: disable=invalid-name
421
+ # pylint: enable=invalid-name
399
422
object1 = NoteOff ("G9" , 0x7F )
400
423
self .assertEqual (object1 .note , 127 )
401
424
self .assertEqual (object1 .velocity , 0x7F )
402
425
403
- def test_NoteOff_constructor_upperrange2 (self ):
426
+ def test_NoteOff_constructor_upperrange2 (self ): # pylint: disable=invalid-name
404
427
with self .assertRaises (ValueError ):
405
428
NoteOff ("G#9" , 0x7F ) # just above max note
406
429
407
- def test_NoteOff_constructor_bogusstring (self ):
430
+ def test_NoteOff_constructor_bogusstring (self ): # pylint: disable=invalid-name
408
431
with self .assertRaises (ValueError ):
409
432
NoteOff ("CC4" , 0x7F )
410
433
0 commit comments