Showing the changes to python/tests/test_filter.py (1 of 1 file). Show all
Unified · Split
| @@ -68,7 +68,21 @@ class aubio_filter_test_case(TestCase): · 67 unmodified lines | ||
| 68 | 68 | u = f(v) |
| 69 | 69 | assert_almost_equal (expected[1][16:], u) |
| 70 | 70 | |
| 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): | |
| 74 | 81 | |
| 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() | |