diff options
| author | Ang Bel <anzelikabelotelova@Anzelikas-MacBook-Air.local> | 2024-08-27 15:18:54 +0100 |
|---|---|---|
| committer | Ang Bel <anzelikabelotelova@Anzelikas-MacBook-Air.local> | 2024-08-27 15:18:54 +0100 |
| commit | 22df92bcce7ec2d9e713b9609ffdd604d207e713 (patch) | |
| tree | 411ac7a2fac0895a977bd44d1e3a62e20e307092 /tests | |
| parent | a05a3718621b2c30b4357e2b90af6da0d89c6990 (diff) | |
| download | de-project-bentley-22df92bcce7ec2d9e713b9609ffdd604d207e713.tar.gz de-project-bentley-22df92bcce7ec2d9e713b9609ffdd604d207e713.zip | |
test: refactored fact functions with test passing
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_dataframes.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_dataframes.py b/tests/test_dataframes.py index 8f32b1d..70aefe8 100644 --- a/tests/test_dataframes.py +++ b/tests/test_dataframes.py @@ -129,7 +129,8 @@ class TestCreateDimTransaction: class TestCreateFactPayment: def test_returns_correct_columns_payment(self): - dict_df = {'payment':pd.DataFrame(data=[[dt(2020,5,17,6,15,20),dt(2020,5,20,8,19,30),1,'SE18 9QO','2020-7-16']], + dict_df = {'payment':pd.DataFrame(data=[[dt.strptime('2022-11-03 14:20:49.962846','%Y-%m-%d %H:%M:%S.%f'), + dt.strptime('2022-12-14 16:20:49.962194','%Y-%m-%d %H:%M:%S.%f'),1,'SE18 9QO','2020-07-16']], columns=['created_at','last_updated','payment_id','some_other_id','payment_date'])} expected_cols = ['payment_record_id','created_date','created_time','last_updated_date', 'last_updated_time','payment_date','payment_id','some_other_id'] @@ -138,7 +139,11 @@ class TestCreateFactPayment: for col in list(result.columns): assert col in expected_cols for col in expected_cols: - if 'date' in col: + if '_date' in col: + print(col) assert result[col].dtype == 'datetime64[ns]' + if '_time' in col: + print(col) + assert result[col].dtype == 'O' #<< O for object
\ No newline at end of file |
