def generate_test_transform_google_timeseries(): symbol = 'GOOG' start = datetime.datetime(2013, 10, 11) end = datetime.datetime(2013, 11, 11) data = data_loader.download_google_timeseries_raw(symbol, start, end) utils.serialise_obj(data, 'testdata/test_transform_google_timeseries.data.py') utils.serialise_obj(data_loader.transform_google_timeseries(data, symbol), 'testdata/test_transform_google_timeseries.result.py')
def test_transform_google_timeseries(self): """ Test the transformation of the raw data received from google into the form we use downstream """ test_data = os.path.join(self.data_folder, 'test_transform_google_timeseries.data.py') data = utils.deserialise_obj(test_data) result = data_loader.transform_google_timeseries(data) test_result = os.path.join(self.data_folder, 'test_transform_google_timeseries.result.py') base_result = utils.deserialise_obj(test_result) self.assertEqual(result, base_result)