Exemple #1
0
    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
Exemple #2
0
    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
Exemple #3
0
 def test_typeerror_input_trace(self):
     with pytest.raises(TypeError):
         lp.export_df(self.df, label='df_account', trace='yes')
Exemple #4
0
 def test_typeerror_input_index(self):
     with pytest.raises(TypeError):
         lp.export_df(self.df, show_index='yes')
Exemple #5
0
 def test_typeerror_input_label(self):
     with pytest.raises(TypeError):
         lp.export_df(self.df, label=1, trace=False)
Exemple #6
0
 def test_typeerror_input_df(self):
     with pytest.raises(TypeError):
         lp.export_df('df')
Exemple #7
0
    def test_file_imported(self):
        lp.export_df(self.df, label='accounts', trace=False)
        df = lp.import_df('accounts.csv')

        assert len(df) > 0