def test_parse_historical_cboe_data(self): test_data = """CBOE data is compiled for the convenience of site ... Date,VIX Open,VIX High,VIX Low,VIX Close 1/2/2004,17.96,18.68,17.54,18.22 1/5/2004,18.45,18.49,17.44,17.49 1/6/2004,17.66,17.67,16.19,16.73 1/7/2004,16.72,16.75,15.5,15.5 """ lines = stocks._parse_historical_cboe_data("VIX", test_data, TEST_DB_NAME) self.assertEqual(lines, 4) self._check_database_quotes("VIX", 4, date(2004, 1, 5), 17.49)
def test_parse_historical_cboe_data_vvix(self): test_data = """CBOE data is compiled for the convenience of site ... Date,VVIX 1/3/2007,87.63 1/4/2007,88.19 1/5/2007,90.17 1/8/2007,92.04 1/9/2007,92.76 """ lines = stocks._parse_historical_cboe_data("VVIX", test_data, TEST_DB_NAME) self.assertEqual(lines, 5) self._check_database_quotes("VVIX", 5, date(2007, 1, 8), 92.04)