예제 #1
0
 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)
예제 #2
0
 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)