def test_final_exported(self): label = "random_numbers" lp.export_df(self.df, label=label, trace=False) expected_file = lp.path_out + lp.timestamp_label + label + '.csv' created_file = glob.glob(expected_file).pop() assert expected_file == created_file
def test_trace_exported(self): lp.export_df(self.df) lp.export_df(self.df) lp.export_df(self.df) lp.export_df(self.df) export_count = 4 all_files = glob.glob( os.path.join(lp.path_out, lp.timestamp_label + 'iteration_' + '*.csv')) file_count = len(all_files) assert export_count == file_count
def test_typeerror_input_trace(self): with pytest.raises(TypeError): lp.export_df(self.df, label='df_account', trace='yes')
def test_typeerror_input_index(self): with pytest.raises(TypeError): lp.export_df(self.df, show_index='yes')
def test_typeerror_input_label(self): with pytest.raises(TypeError): lp.export_df(self.df, label=1, trace=False)
def test_typeerror_input_df(self): with pytest.raises(TypeError): lp.export_df('df')
def test_file_imported(self): lp.export_df(self.df, label='accounts', trace=False) df = lp.import_df('accounts.csv') assert len(df) > 0