Skip to content

Commit 2de0cec

Browse files
committed
Added many more ignores, fixed some variable names
1 parent d361d81 commit 2de0cec

File tree

2 files changed

+186
-153
lines changed

2 files changed

+186
-153
lines changed

tests/test_MIDIMessage_unittests.py

Lines changed: 57 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@
3030

3131
# pylint: enable=wrong-import-position
3232

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
3838
data = bytes([0x90, 0x30, 0x7F])
3939
ichannel = 0
4040

@@ -49,7 +49,8 @@ def test_NoteOn_basic(self):
4949
self.assertEqual(skipped, 0)
5050
self.assertEqual(msg.channel, 0)
5151

52-
def test_NoteOn_awaitingthirdbyte(self):
52+
def test_NoteOn_awaitingthirdbyte(self): # pylint: disable=invalid-name
53+
# pylint: enable=invalid-name
5354
data = bytes([0x90, 0x30])
5455
ichannel = 0
5556

@@ -69,7 +70,8 @@ def test_NoteOn_awaitingthirdbyte(self):
6970
)
7071
self.assertEqual(skipped, 0)
7172

72-
def test_NoteOn_predatajunk(self):
73+
def test_NoteOn_predatajunk(self): # pylint: disable=invalid-name
74+
# pylint: enable=invalid-name
7375
data = bytes([0x20, 0x64, 0x90, 0x30, 0x32])
7476
ichannel = 0
7577

@@ -88,7 +90,8 @@ def test_NoteOn_predatajunk(self):
8890
self.assertEqual(skipped, 2)
8991
self.assertEqual(msg.channel, 0)
9092

91-
def test_NoteOn_prepartialsysex(self):
93+
def test_NoteOn_prepartialsysex(self): # pylint: disable=invalid-name
94+
# pylint: enable=invalid-name
9295
data = bytes([0x01, 0x02, 0x03, 0x04, 0xF7, 0x90, 0x30, 0x32])
9396
ichannel = 0
9497

@@ -124,7 +127,8 @@ def test_NoteOn_prepartialsysex(self):
124127
self.assertEqual(skipped, 0)
125128
self.assertEqual(msg.channel, 0)
126129

127-
def test_NoteOn_postNoteOn(self):
130+
def test_NoteOn_postNoteOn(self): # pylint: disable=invalid-name
131+
# pylint: enable=invalid-name
128132
data = bytes([0x90 | 0x08, 0x30, 0x7F, 0x90 | 0x08, 0x37, 0x64])
129133
ichannel = 8
130134

@@ -139,7 +143,8 @@ def test_NoteOn_postNoteOn(self):
139143
self.assertEqual(skipped, 0)
140144
self.assertEqual(msg.channel, 8)
141145

142-
def test_NoteOn_postpartialNoteOn(self):
146+
def test_NoteOn_postpartialNoteOn(self): # pylint: disable=invalid-name
147+
# pylint: enable=invalid-name
143148
data = bytes([0x90, 0x30, 0x7F, 0x90, 0x37])
144149
ichannel = 0
145150

@@ -154,7 +159,8 @@ def test_NoteOn_postpartialNoteOn(self):
154159
self.assertEqual(skipped, 0)
155160
self.assertEqual(msg.channel, 0)
156161

157-
def test_NoteOn_preotherchannel(self):
162+
def test_NoteOn_preotherchannel(self): # pylint: disable=invalid-name
163+
# pylint: enable=invalid-name
158164
data = bytes([0x90 | 0x05, 0x30, 0x7F, 0x90 | 0x03, 0x37, 0x64])
159165
ichannel = 3
160166

@@ -169,7 +175,10 @@ def test_NoteOn_preotherchannel(self):
169175
self.assertEqual(skipped, 0)
170176
self.assertEqual(msg.channel, 3)
171177

172-
def test_NoteOn_preotherchannelplusintermediatejunk(self):
178+
def test_NoteOn_preotherchannelplusintermediatejunk(
179+
self,
180+
): # pylint: disable=invalid-name
181+
# pylint: enable=invalid-name
173182
data = bytes([0x90 | 0x05, 0x30, 0x7F, 0x00, 0x00, 0x90 | 0x03, 0x37, 0x64])
174183
ichannel = 3
175184

@@ -186,7 +195,8 @@ def test_NoteOn_preotherchannelplusintermediatejunk(self):
186195
self.assertEqual(skipped, 0)
187196
self.assertEqual(msg.channel, 3)
188197

189-
def test_NoteOn_wrongchannel(self):
198+
def test_NoteOn_wrongchannel(self): # pylint: disable=invalid-name
199+
# pylint: enable=invalid-name
190200
data = bytes([0x95, 0x30, 0x7F])
191201
ichannel = 3
192202

@@ -198,7 +208,8 @@ def test_NoteOn_wrongchannel(self):
198208
self.assertEqual(msgendidxplusone, 3, "wrong channel message discarded")
199209
self.assertEqual(skipped, 0)
200210

201-
def test_NoteOn_partialandpreotherchannel1(self):
211+
def test_NoteOn_partialandpreotherchannel1(self): # pylint: disable=invalid-name
212+
# pylint: enable=invalid-name
202213
data = bytes([0x95, 0x30, 0x7F, 0x93])
203214
ichannel = 3
204215

@@ -212,7 +223,8 @@ def test_NoteOn_partialandpreotherchannel1(self):
212223
)
213224
self.assertEqual(skipped, 0)
214225

215-
def test_NoteOn_partialandpreotherchannel2(self):
226+
def test_NoteOn_partialandpreotherchannel2(self): # pylint: disable=invalid-name
227+
# pylint: enable=invalid-name
216228
data = bytes([0x95, 0x30, 0x7F, 0x93, 0x37])
217229
ichannel = 3
218230

@@ -226,7 +238,8 @@ def test_NoteOn_partialandpreotherchannel2(self):
226238
)
227239
self.assertEqual(skipped, 0)
228240

229-
def test_NoteOn_constructor_int(self):
241+
def test_NoteOn_constructor_int(self): # pylint: disable=invalid-name
242+
# pylint: enable=invalid-name
230243
object1 = NoteOn(60, 0x7F)
231244

232245
self.assertEqual(object1.note, 60)
@@ -251,7 +264,8 @@ def test_NoteOn_constructor_int(self):
251264
self.assertEqual(object4.velocity, 127)
252265
self.assertIsNone(object4.channel)
253266

254-
def test_SystemExclusive_NoteOn(self):
267+
def test_SystemExclusive_NoteOn(self): # pylint: disable=invalid-name
268+
# pylint: enable=invalid-name
255269
data = bytes([0xF0, 0x42, 0x01, 0x02, 0x03, 0x04, 0xF7, 0x90 | 14, 0x30, 0x60])
256270
ichannel = 14
257271

@@ -279,7 +293,10 @@ def test_SystemExclusive_NoteOn(self):
279293
self.assertEqual(skipped, 0)
280294
self.assertEqual(msg.channel, 14)
281295

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
283300
data = bytes([0xF0, 0x42, 0x01, 0x02, 0x03, 0x04, 0xF0, 0x90, 0x30, 0x32])
284301
ichannel = 0
285302

@@ -294,7 +311,8 @@ def test_SystemExclusive_NoteOn_premalterminatedsysex(self):
294311
skipped, 0, "If SystemExclusive class is imported then this must be 0"
295312
)
296313

297-
def test_Unknown_SinglebyteStatus(self):
314+
def test_Unknown_SinglebyteStatus(self): # pylint: disable=invalid-name
315+
# pylint: enable=invalid-name
298316
data = bytes([0xFD])
299317
ichannel = 0
300318

@@ -307,7 +325,8 @@ def test_Unknown_SinglebyteStatus(self):
307325
self.assertEqual(skipped, 0)
308326
self.assertIsNone(msg.channel)
309327

310-
def test_Empty(self):
328+
def test_Empty(self): # pylint: disable=invalid-name
329+
# pylint: enable=invalid-name
311330
data = bytes([])
312331
ichannel = 0
313332

@@ -323,7 +342,8 @@ def test_Empty(self):
323342
class Test_MIDIMessage_NoteOn_constructor(
324343
unittest.TestCase
325344
): # 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
327347
object1 = NoteOn("C4", 0x64)
328348
self.assertEqual(object1.note, 60)
329349
self.assertEqual(object1.velocity, 0x64)
@@ -336,28 +356,29 @@ def test_NoteOn_constructor_string(self):
336356
self.assertEqual(object3.note, 61)
337357
self.assertEqual(object3.velocity, 0)
338358

339-
def test_NoteOn_constructor_valueerror1(self):
359+
def test_NoteOn_constructor_valueerror1(self): # pylint: disable=invalid-name
340360
with self.assertRaises(ValueError):
341361
NoteOn(60, 0x80) # pylint is happier if return value not stored
342362

343-
def test_NoteOn_constructor_valueerror2(self):
363+
def test_NoteOn_constructor_valueerror2(self): # pylint: disable=invalid-name
344364
with self.assertRaises(ValueError):
345365
NoteOn(-1, 0x7F)
346366

347-
def test_NoteOn_constructor_valueerror3(self):
367+
def test_NoteOn_constructor_valueerror3(self): # pylint: disable=invalid-name
348368
with self.assertRaises(ValueError):
349369
NoteOn(128, 0x7F)
350370

351-
def test_NoteOn_constructor_upperrange1(self):
371+
def test_NoteOn_constructor_upperrange1(self): # pylint: disable=invalid-name
372+
# pylint: enable=invalid-name
352373
object1 = NoteOn("G9", 0x7F)
353374
self.assertEqual(object1.note, 127)
354375
self.assertEqual(object1.velocity, 0x7F)
355376

356-
def test_NoteOn_constructor_upperrange2(self):
377+
def test_NoteOn_constructor_upperrange2(self): # pylint: disable=invalid-name
357378
with self.assertRaises(ValueError):
358379
NoteOn("G#9", 0x7F) # just above max note
359380

360-
def test_NoteOn_constructor_bogusstring(self):
381+
def test_NoteOn_constructor_bogusstring(self): # pylint: disable=invalid-name
361382
with self.assertRaises(ValueError):
362383
NoteOn("CC4", 0x7F)
363384

@@ -366,7 +387,8 @@ class Test_MIDIMessage_NoteOff_constructor(
366387
unittest.TestCase
367388
): # pylint: disable=invalid-name
368389
# 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
370392
object1 = NoteOff("C4", 0x64)
371393
self.assertEqual(object1.note, 60)
372394
self.assertEqual(object1.velocity, 0x64)
@@ -383,28 +405,29 @@ def test_NoteOff_constructor_string(self):
383405
self.assertEqual(object4.note, 61)
384406
self.assertEqual(object4.velocity, 0)
385407

386-
def test_NoteOff_constructor_valueerror1(self):
408+
def test_NoteOff_constructor_valueerror1(self): # pylint: disable=invalid-name
387409
with self.assertRaises(ValueError):
388410
NoteOff(60, 0x80)
389411

390-
def test_NoteOff_constructor_valueerror2(self):
412+
def test_NoteOff_constructor_valueerror2(self): # pylint: disable=invalid-name
391413
with self.assertRaises(ValueError):
392414
NoteOff(-1, 0x7F)
393415

394-
def test_NoteOff_constructor_valueerror3(self):
416+
def test_NoteOff_constructor_valueerror3(self): # pylint: disable=invalid-name
395417
with self.assertRaises(ValueError):
396418
NoteOff(128, 0x7F)
397419

398-
def test_NoteOff_constructor_upperrange1(self):
420+
def test_NoteOff_constructor_upperrange1(self): # pylint: disable=invalid-name
421+
# pylint: enable=invalid-name
399422
object1 = NoteOff("G9", 0x7F)
400423
self.assertEqual(object1.note, 127)
401424
self.assertEqual(object1.velocity, 0x7F)
402425

403-
def test_NoteOff_constructor_upperrange2(self):
426+
def test_NoteOff_constructor_upperrange2(self): # pylint: disable=invalid-name
404427
with self.assertRaises(ValueError):
405428
NoteOff("G#9", 0x7F) # just above max note
406429

407-
def test_NoteOff_constructor_bogusstring(self):
430+
def test_NoteOff_constructor_bogusstring(self): # pylint: disable=invalid-name
408431
with self.assertRaises(ValueError):
409432
NoteOff("CC4", 0x7F)
410433

0 commit comments

Comments
 (0)