Showing the changes to python/tests/test_note2midi.py (1 of 2 files). Show all
Unified · Split
| @@ -12,9 +12,10 @@ list_of_known_notes = ( · 11 unmodified lines | ||
| 12 | 12 | ( 'B#3', 60 ), |
| 13 | 13 | ( 'A4', 69 ), |
| 14 | 14 | ( 'A#4', 70 ), |
| 15 | + ( 'Bb4', 70 ), | |
| 16 | + ( u'B♭4', 70 ), | |
| 15 | 17 | ( 'G8', 115 ), |
| 16 | 18 | ( u'G♯8', 116 ), |
| 17 | − ( u'G♭9', 126 ), | |
| 18 | 19 | ( 'G9', 127 ), |
| 19 | 20 | ( u'G\udd2a2', 45 ), |
| 20 | 21 | ( u'B\ufffd2', 45 ), |
| @@ -35,20 +36,24 @@ class TestNote2MidiWrongValues(unittest.TestCase): · 14 unmodified lines | ||
| 35 | 36 | self.assertRaises(ValueError, note2midi, 'C') |
| 36 | 37 | |
| 37 | 38 | def test_note2midi_wrong_modifier(self): |
| 38 | − " fails when passed an invalid note name" | |
| 39 | + " fails when passed a note with an invalid modifier " | |
| 39 | 40 | self.assertRaises(ValueError, note2midi, 'C.1') |
| 40 | 41 | |
| 41 | − def test_note2midi_wronge_midifier_again(self): | |
| 42 | − " fails when passed a wrong modifier" | |
| 42 | + def test_note2midi_another_wrong_modifier_again(self): | |
| 43 | + " fails when passed a note with a invalid note name " | |
| 43 | 44 | self.assertRaises(ValueError, note2midi, 'CB-3') |
| 44 | 45 | |
| 45 | 46 | def test_note2midi_wrong_octave(self): |
| 46 | − " fails when passed a wrong octave" | |
| 47 | + " fails when passed a wrong octave number " | |
| 47 | 48 | self.assertRaises(ValueError, note2midi, 'CBc') |
| 48 | 49 | |
| 49 | 50 | def test_note2midi_out_of_range(self): |
| 50 | − " fails when passed a non-existing note" | |
| 51 | + " fails when passed a out of range note" | |
| 51 | 52 | self.assertRaises(ValueError, note2midi, 'A9') |
| 52 | 53 | |
| 54 | + def test_note2midi_wrong_data_type(self): | |
| 55 | + " fails when passed a non-string value " | |
| 56 | + self.assertRaises(TypeError, note2midi, 123) | |
| 57 | + | |
| 53 | 58 | if __name__ == '__main__': |
| 54 | 59 | unittest.main() |