예제 #1
0
 def test_url_file(self):
     new_filename, data, result_meta = loading.load_input_file(
         None, min_trans_url, None)
     assert len(data) == 8
     assert data.iloc[
         6].Description == 'nothing suspicious about this tax payment'
     assert data['Amount Num.'].sum() == 0
     assert '8 records' in result_meta
예제 #2
0
 def test_input_file(self):
     new_filename, data, result_meta = loading.load_input_file(
         min_trans_input_file, None, min_trans_filename)
     assert len(data) == 8
     assert data.iloc[4].Description == 'cocaine habit'
     assert new_filename == min_trans_filename
     assert data['Amount Num.'].sum() == 0
     assert '8 records' in result_meta
예제 #3
0
 def test_min_trans(self):
     new_filename, data, result_meta = loading.load_input_file(
         min_trans_input_file, None, min_trans_filename)
     renamed = loading.rename_columns(data, def_params)
     trans = loading.load_transactions(renamed)
     assert len(trans) == 8
     assert trans['date'].min() == pd.Timestamp('2017-01-01 00:00:00')
     assert trans.iloc[0][
         'full account name'] == 'Assets:Current Assets:Cash in Wallet'
예제 #4
0
 def test_min(self):
     new_filename, data, result_meta = loading.load_input_file(
         min_trans_input_file, None, min_trans_filename)
     old_col = 'Amount Num.'
     new_col = params.CONST['amount_col']
     assert old_col in data.columns
     renamed = loading.rename_columns(data, def_params)
     assert new_col in renamed.columns
     assert old_col not in renamed.columns
예제 #5
0
 def test_min(self):
     new_filename, raw_trans, result_meta = loading.load_input_file(
         min_trans_input_file, None, min_trans_filename)
     trans, atree, eras = loading.convert_raw_data(raw_trans,
                                                   pd.DataFrame(),
                                                   pd.DataFrame(),
                                                   parameters=def_params)
     assert len(trans) == 8
     assert trans[trans['account'] == 'Salary'].amount.sum() == 3875
     assert trans['date'].min() == pd.Timestamp('2017-01-01 00:00:00')