projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
84838c3
)
python/tests/test_filter.py: add tests
author
Paul Brossier
<piem@piem.org>
Wed, 11 May 2016 00:52:19 +0000
(
02:52
+0200)
committer
Paul Brossier
<piem@piem.org>
Wed, 11 May 2016 00:52:19 +0000
(
02:52
+0200)
python/tests/test_filter.py
patch
|
blob
|
history
diff --git
a/python/tests/test_filter.py
b/python/tests/test_filter.py
index
da4ef89
..
15c5555
100755
(executable)
--- 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)
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()