def test_volatility_invalid_period(self): period = 128 with self.assertRaises(Exception) as cm: volatility.volatility(self.data, period) expected = "Error: data_len < period" self.assertEqual(str(cm.exception), expected)
def test_volatility_period_10(self): period = 10 v = volatility.volatility(self.data, period) np.testing.assert_array_equal(v, self.volatility_period_10_expected)