Changeset d554321 for python/tests
- Timestamp:
- Dec 2, 2016, 1:44:12 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, sampler, yinfft+
- Children:
- 3aad0b1
- Parents:
- 473ab11
- Location:
- python/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_midi2note.py
r473ab11 rd554321 3 3 4 4 from aubio import midi2note 5 from nose2.tools import params 5 6 import unittest 6 7 … … 17 18 class midi2note_good_values(unittest.TestCase): 18 19 19 def test_midi2note_known_values(self): 20 @params(*list_of_known_midis) 21 def test_midi2note_known_values(self, midi, note): 20 22 " known values are correctly converted " 21 for midi, note in list_of_known_midis: 22 self.assertEqual ( midi2note(midi), note ) 23 self.assertEqual ( midi2note(midi), note ) 23 24 24 25 class midi2note_wrong_values(unittest.TestCase): … … 41 42 42 43 if __name__ == '__main__': 43 unittest.main() 44 import nose2 45 nose2.main() -
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.