def window_as_window_args(self, window_type, window_width, beta, expected): res = window(window_width, window_type, beta) self.assertIsInstance(res, np.ndarray) # octave gives results to five places (single precision float?) for i in range(len(expected)): self.assertAlmostEqual(res[i], expected[i], places=5, msg='at index {}:\n{}\n vs\n{}'.format( i, res, expected))
def test_window_bad_window_type(self): with self.assertRaises(ValueError): window(10, 'bad') with self.assertRaises(ValueError): window(10, 'longerbad') with self.assertRaises(ValueError): window(10, 'rec') # Not four chars.
def test_window_bad_window_type(self): with self.assertRaises(ValueError): window(10, "bad") with self.assertRaises(ValueError): window(10, "longerbad") with self.assertRaises(ValueError): window(10, "rec") # Not four chars.
def test_kais_not_implemented(self): with self.assertRaises(NotImplementedError): window(10, 'kais', 0)