History

python/tests/test_filter.py: add tests

Paul Brossier committed 10 years ago

Commit 2871e2b1 parent 84838c31 file · +17 −3Browse files

Showing the changes to python/tests/test_filter.py (1 of 1 file). Show all

Unified · Split

python/tests/test_filter.py+17−3
@@ -68,7 +68,21 @@ class aubio_filter_test_case(TestCase): · 67 unmodified lines
6868 u = f(v)
6969 assert_almost_equal (expected[1][16:], u)
7070
71−if __name__ == '__main__':
72− from unittest import main
73− main()
71+ def test_set_biquad(self):
72+ f = digital_filter(3)
73+ f.set_biquad(0., 0., 0, 0., 0.)
74+
75+ def test_set_biquad_wrong_order(self):
76+ f = digital_filter(4)
77+ with self.assertRaises(ValueError):
78+ f.set_biquad(0., 0., 0, 0., 0.)
79+
80+class aubio_filter_wrong_params(TestCase):
7481
82+ def test_negative_order(self):
83+ with self.assertRaises(ValueError):
84+ digital_filter(-1)
85+
86+if __name__ == '__main__':
87+ from unittest import main
88+ main()

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t