diff options
| author | Ang Bel <anzelikabelotelova@Anzelikas-MacBook-Air.local> | 2024-08-27 15:18:54 +0100 |
|---|---|---|
| committer | Ellie <ecsymonds@gmail.com> | 2024-08-28 09:12:00 +0100 |
| commit | 8588d4b318d7732d33a59bc6c8b93870310668c5 (patch) | |
| tree | d5419820b1dd928a1b81f0846500f2a34508d27a /tests | |
| parent | aed1c19a39062e8fe86cf0a531b8d1486b06d1ac (diff) | |
| download | de-project-bentley-8588d4b318d7732d33a59bc6c8b93870310668c5.tar.gz de-project-bentley-8588d4b318d7732d33a59bc6c8b93870310668c5.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 |
