[test] improve coverage of filters
authorPaul Brossier <piem@piem.org>
Sat, 17 Nov 2018 18:47:12 +0000 (19:47 +0100)
committerPaul Brossier <piem@piem.org>
Sat, 17 Nov 2018 18:47:12 +0000 (19:47 +0100)
python/tests/test_filter.py

index 6a7a0de..72f5f4d 100755 (executable)
@@ -77,6 +77,16 @@ class aubio_filter_test_case(TestCase):
         with self.assertRaises(ValueError):
             f.set_biquad(0., 0., 0, 0., 0.)
 
         with self.assertRaises(ValueError):
             f.set_biquad(0., 0., 0, 0., 0.)
 
+    def test_all_available_presets(self):
+        f = digital_filter(7)
+        for sr in [8000, 11025, 16000, 22050, 24000, 32000,
+                44100, 48000, 88200, 96000, 192000]:
+            f.set_a_weighting(sr)
+        f = digital_filter(5)
+        for sr in [8000, 11025, 16000, 22050, 24000, 32000,
+                44100, 48000, 88200, 96000, 192000]:
+            f.set_c_weighting(sr)
+
 class aubio_filter_wrong_params(TestCase):
 
     def test_negative_order(self):
 class aubio_filter_wrong_params(TestCase):
 
     def test_negative_order(self):