source: python/tests/test_musicutils.py @ 5e394ecc

feature/autosinkfeature/constantqfeature/pitchshiftfeature/pydocstringsfeature/timestretchpitchshiftsamplertimestretchyinfft+
Last change on this file since 5e394ecc was 5e394ecc, checked in by Paul Brossier <piem@piem.org>, 5 years ago

tests/test_musicutils.py: improve test

  • Property mode set to 100755
File size: 712 bytes
Line 
1#! /usr/bin/env python
2
3from numpy.testing import TestCase
4from aubio import window
5
6class aubio_window(TestCase):
7
8    def test_accept_name_and_size(self):
9        window("default", 1024)
10
11    def test_fail_name_not_string(self):
12        try:
13            window(10, 1024)
14        except ValueError, e:
15            pass
16        else:
17            self.fail('non-string window type does not raise a ValueError')
18
19    def test_fail_size_not_int(self):
20        try:
21            window("default", "default")
22        except ValueError, e:
23            pass
24        else:
25            self.fail('non-integer window length does not raise a ValueError')
26
27if __name__ == '__main__':
28    from unittest import main
29    main()
Note: See TracBrowser for help on using the repository browser.