From 2871e2b03bbc9800615603264aeacb91b347ff07 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 11 May 2016 02:52:19 +0200 Subject: [PATCH] python/tests/test_filter.py: add tests --- python/tests/test_filter.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/python/tests/test_filter.py b/python/tests/test_filter.py index da4ef895..15c55554 100755 --- a/python/tests/test_filter.py +++ b/python/tests/test_filter.py @@ -68,7 +68,21 @@ class aubio_filter_test_case(TestCase): u = f(v) assert_almost_equal (expected[1][16:], u) -if __name__ == '__main__': - from unittest import main - main() + def test_set_biquad(self): + f = digital_filter(3) + f.set_biquad(0., 0., 0, 0., 0.) + + def test_set_biquad_wrong_order(self): + f = digital_filter(4) + with self.assertRaises(ValueError): + f.set_biquad(0., 0., 0, 0., 0.) + +class aubio_filter_wrong_params(TestCase): + def test_negative_order(self): + with self.assertRaises(ValueError): + digital_filter(-1) + +if __name__ == '__main__': + from unittest import main + main() -- 2.11.0