Changeset d554321 for python/tests/test_note2midi.py
- Timestamp:
- Dec 2, 2016, 1:44:12 PM (7 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, sampler, yinfft+
- Children:
- 3aad0b1
- Parents:
- 473ab11
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_note2midi.py
r473ab11 rd554321 5 5 6 6 from aubio import note2midi, freq2note 7 from nose2.tools import params 7 8 import unittest 8 9 … … 14 15 ( 'B3', 59 ), 15 16 ( 'B#3', 60 ), 17 ( 'C\u266f4', 61 ), 18 ( 'C\U0001D12A4', 62 ), 19 ( 'E\U0001D12B4', 62 ), 16 20 ( 'A4', 69 ), 17 21 ( 'A#4', 70 ), … … 28 32 class note2midi_good_values(unittest.TestCase): 29 33 30 def test_note2midi_known_values(self): 34 @params(*list_of_known_notes) 35 def test_note2midi_known_values(self, note, midi): 31 36 " known values are correctly converted " 32 for note, midi in list_of_known_notes: 33 self.assertEqual ( note2midi(note), midi ) 37 self.assertEqual ( note2midi(note), midi ) 34 38 35 39 class note2midi_wrong_values(unittest.TestCase): … … 75 79 76 80 if __name__ == '__main__': 77 unittest.main() 81 import nose2 82 nose2.main()
Note: See TracChangeset
for help on using the changeset viewer.