Changeset 6db7600
- Timestamp:
- Apr 18, 2016, 11:27:54 PM (9 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:
- 376d5e9
- Parents:
- 689106e
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_note2midi.py
r689106e r6db7600 2 2 # -*- coding: utf-8 -*- 3 3 4 from aubio import note2midi 4 from aubio import note2midi, freq2note 5 5 import unittest 6 6 … … 50 50 51 51 def test_note2midi_out_of_range(self): 52 " fails when passed a out of range note"52 " fails when passed a note out of range" 53 53 self.assertRaises(ValueError, note2midi, 'A9') 54 55 def test_note2midi_wrong_note_name(self): 56 " fails when passed a note with a wrong name" 57 self.assertRaises(ValueError, note2midi, 'W9') 58 59 def test_note2midi_wrong_octave(self): 60 " fails when passed a note with a wrong octave" 61 self.assertRaises(ValueError, note2midi, 'C-9') 54 62 55 63 def test_note2midi_wrong_data_type(self): … … 57 65 self.assertRaises(TypeError, note2midi, 123) 58 66 67 68 class freq2note_simple_test(unittest.TestCase): 69 70 def test_freq2note(self): 71 " make sure freq2note(441) == A4 " 72 self.assertEquals("A4", freq2note(441)) 73 59 74 if __name__ == '__main__': 60 75 unittest.main()
Note: See TracChangeset
for help on using the changeset viewer.