Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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()))
Exemplo n.º 3
0
 def test_label_csv2(self):
     self.assertEqual(
         data_as_list(),
         get_labelled_rows(raw_data_file(), spec_file(), cfg_file()))
Exemplo n.º 4
0
 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())
Exemplo n.º 5
0
 def test_label_csv2(self):
     self.assertEqual(data_as_list(), get_labelled_rows(raw_data_file(), spec_file(), cfg_file()))
Exemplo n.º 6
0
 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())
Exemplo n.º 7
0
 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()))
Exemplo n.º 8
0
 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)