Changeset f264b17 for python/tests/test_note2midi.py
- Timestamp:
- Jun 22, 2016, 1:00:10 PM (8 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 4b9443c4
- Parents:
- 60fc05b (diff), 6769586 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_note2midi.py
r60fc05b rf264b17 2 2 # -*- coding: utf-8 -*- 3 3 4 from aubio import note2midi 4 from __future__ import unicode_literals 5 6 from aubio import note2midi, freq2note 5 7 import unittest 6 8 … … 15 17 ( 'A#4', 70 ), 16 18 ( 'Bb4', 70 ), 17 ( u'B♭4', 70 ),19 ( 'B♭4', 70 ), 18 20 ( 'G8', 115 ), 19 ( u'G♯8', 116 ),21 ( 'G♯8', 116 ), 20 22 ( 'G9', 127 ), 21 ( u'G\udd2a2', 45 ),22 ( u'B\ufffd2', 45 ),23 ( u'A♮2', 45 ),23 ( 'G\udd2a2', 45 ), 24 ( 'B\ufffd2', 45 ), 25 ( 'A♮2', 45 ), 24 26 ) 25 27 … … 50 52 51 53 def test_note2midi_out_of_range(self): 52 " fails when passed a out of range note"54 " fails when passed a note out of range" 53 55 self.assertRaises(ValueError, note2midi, 'A9') 56 57 def test_note2midi_wrong_note_name(self): 58 " fails when passed a note with a wrong name" 59 self.assertRaises(ValueError, note2midi, 'W9') 60 61 def test_note2midi_low_octave(self): 62 " fails when passed a note with a too low octave" 63 self.assertRaises(ValueError, note2midi, 'C-9') 54 64 55 65 def test_note2midi_wrong_data_type(self): … … 57 67 self.assertRaises(TypeError, note2midi, 123) 58 68 69 70 class freq2note_simple_test(unittest.TestCase): 71 72 def test_freq2note(self): 73 " make sure freq2note(441) == A4 " 74 self.assertEqual("A4", freq2note(441)) 75 59 76 if __name__ == '__main__': 60 77 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.