Changeset 5a7e2c3 for python/tests
- Timestamp:
- Jul 10, 2015, 1:51:25 AM (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:
- 4615886a
- Parents:
- efa62ce
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_musicutils.py
refa62ce r5a7e2c3 2 2 3 3 from numpy.testing import TestCase 4 from numpy.testing.utils import assert_almost_equal 5 from aubio import window 4 from numpy.testing.utils import assert_equal, assert_almost_equal 5 from numpy import cos, arange 6 from math import pi 7 8 from aubio import window, level_lin 9 10 from aubio import fvec 6 11 7 12 class aubio_window(TestCase): … … 27 32 28 33 def test_compute_hanning_1024(self): 29 from numpy import cos, arange30 from math import pi31 34 size = 1024 32 35 aubio_window = window("hanning", size) … … 34 37 assert_almost_equal(aubio_window, numpy_window) 35 38 39 class aubio_level_lin(TestCase): 40 def test_accept_fvec(self): 41 level_lin(fvec(1024)) 42 43 def test_fail_not_fvec(self): 44 try: 45 level_lin("default") 46 except ValueError, e: 47 pass 48 else: 49 self.fail('non-number input phase does not raise a TypeError') 50 51 def test_zeros_is_zeros(self): 52 assert_equal(level_lin(fvec(1024)), 0.) 53 54 def test_minus_ones_is_one(self): 55 from numpy import ones 56 assert_equal(level_lin(-ones(1024, dtype="float32")), 1.) 57 36 58 if __name__ == '__main__': 37 59 from unittest import main
Note: See TracChangeset
for help on using the changeset viewer.