shithub: aubio

Download patch

ref: ed938a2fe635b0f432f897f863e83dd9532f2a08
parent: 31223279aff695fce4c78491d14e994ac4755592
author: Paul Brossier <piem@piem.org>
date: Sat May 14 01:21:01 EDT 2016

python/tests/test_filterbank.py: check for wrong values

--- a/python/tests/test_filterbank.py
+++ b/python/tests/test_filterbank.py
@@ -61,6 +61,14 @@
         f.set_mel_coeffs_slaney(16000)
         assert_almost_equal ( expected, f.get_coeffs() )
 
+class aubio_filterbank_wrong_values(TestCase):
+
+    def test_negative_window(self):
+        self.assertRaises(ValueError, filterbank, 40, -20)
+
+    def test_negative_filters(self):
+        self.assertRaises(RuntimeError, filterbank, -40, 1024)
+
     def test_filterbank_long_cvec(self):
         f = filterbank(40, 512)
         with self.assertRaises(ValueError):