Showing the changes to python/tests/test_fft.py (1 of 1 file). Show all
Unified · Split
| @@ -164,6 +164,27 @@ class aubio_fft_test_case(TestCase): · 163 unmodified lines | |||
| 164 | with self.assertRaises(ValueError): | 164 | with self.assertRaises(ValueError): |
| 165 | f.rdo(s) | 165 | f.rdo(s) |
| 166 | 166 | ||
| 167 | class aubio_fft_wrong_params(TestCase): | ||
| 168 | |||
| 169 | def test_wrong_buf_size(self): | ||
| 170 | win_s = -1 | ||
| 171 | with self.assertRaises(ValueError): | ||
| 172 | fft(win_s) | ||
| 173 | |||
| 174 | def test_buf_size_not_power_of_two(self): | ||
| 175 | # when compiled with fftw3, aubio supports non power of two fft sizes | ||
| 176 | win_s = 320 | ||
| 177 | try: | ||
| 178 | with self.assertRaises(RuntimeError): | ||
| 179 | fft(win_s) | ||
| 180 | except AssertionError as e: | ||
| 181 | self.skipTest('creating aubio.fft with size %d did not fail' % win_s) | ||
| 182 | |||
| 183 | def test_buf_size_too_small(self): | ||
| 184 | win_s = 1 | ||
| 185 | with self.assertRaises(RuntimeError): | ||
| 186 | fft(win_s) | ||
| 187 | |||
| 167 | if __name__ == '__main__': | 188 | if __name__ == '__main__': |
| 168 | from nose2 import main | 189 | from nose2 import main |
| 169 | main() | 190 | main() |