Changes in python/tests/test_onset.py [319edae:11c0d74]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_onset.py
r319edae r11c0d74 1 1 #! /usr/bin/env python 2 2 3 from unittest import main 3 4 from numpy.testing import TestCase, assert_equal, assert_almost_equal 4 from aubio import onset 5 from aubio import onset, fvec 5 6 6 7 class aubio_onset_default(TestCase): … … 83 84 samplerate = 8000 84 85 86 class aubio_onset_coverate(TestCase): 87 # extra tests to execute the C routines and improve coverage 88 89 def test_all_methods(self): 90 for method in ['default', 'energy', 'hfc', 'complexdomain', 'complex', 91 'phase', 'wphase', 'mkl', 'kl', 'specflux', 'specdiff', 92 'old_default']: 93 o = onset(method=method, buf_size=512, hop_size=256) 94 o(fvec(256)) 95 96 def test_get_methods(self): 97 o = onset(method='default', buf_size=512, hop_size=256) 98 99 assert o.get_silence() == -70 100 o.set_silence(-20) 101 assert_almost_equal(o.get_silence(), -20) 102 103 assert o.get_compression() == 1 104 o.set_compression(.99) 105 assert_almost_equal(o.get_compression(), .99) 106 107 assert o.get_awhitening() == 0 108 o.set_awhitening(1) 109 assert o.get_awhitening() == 1 110 111 o.get_last() 112 o.get_last_ms() 113 o.get_last_s() 114 o.get_descriptor() 115 o.get_thresholded_descriptor() 116 117 85 118 if __name__ == '__main__': 86 from unittest import main87 119 main()
Note: See TracChangeset
for help on using the changeset viewer.