def generate_test_transform_yahoo_timeseries(): symbol = 'IBM' start = datetime.datetime(2013, 10, 11) end = datetime.datetime(2013, 11, 11) data = data_loader.download_yahoo_timeseries_raw(symbol, start, end) utils.serialise_obj(data, 'testdata/test_transform_yahoo_timeseries.data.py') utils.serialise_obj(data_loader.transform_yahoo_timeseries(data, symbol), 'testdata/test_transform_yahoo_timeseries.result.py')
def test_transform_yahoo_timeseries(self): """ Test the transformation of the raw data received from yahoo into the form we use downstream """ test_data = os.path.join(self.data_folder, 'test_transform_yahoo_timeseries.data.py') data = utils.deserialise_obj(test_data) result = data_loader.transform_yahoo_timeseries(data) test_result = os.path.join(self.data_folder, 'test_transform_yahoo_timeseries.result.py') base_result = utils.deserialise_obj(test_result) self.assertEqual(result, base_result)