def test_database(self): gen = list( stream_flat_data( get_labelled_rows(raw_data_file(), spec_file(), cfg_file()))) stream_to_database(gen) dfa, dfq, dfm = get_reshaped_dfs() self.assertEqual(dfa.loc[2014, 'I_yoy'], 97.3)
def test_import(self): self.assertTrue(os.path.exists(raw_data_file())) self.assertTrue(os.path.exists(spec_file())) self.assertTrue(os.path.exists(cfg_file()))
def test_label_csv2(self): self.assertEqual( data_as_list(), get_labelled_rows(raw_data_file(), spec_file(), cfg_file()))
def test_specs(self): header_dict, unit_dict = load_spec(spec_file()) self.assertEqual(header_dict, ref_header_dict()) self.assertEqual(unit_dict, ref_unit_dict())
def test_label_csv2(self): self.assertEqual(data_as_list(), get_labelled_rows(raw_data_file(), spec_file(), cfg_file()))
def test_database(self): gen = list(stream_flat_data(get_labelled_rows(raw_data_file(), spec_file(), cfg_file()))) stream_to_database(gen) dfa, dfq, dfm = get_reshaped_dfs() self.assertEqual(dfa.loc[2014, 'I_yoy'], 97.3)