diff options
| author | T-Aji <tolujbd2@gmail.com> | 2024-08-22 11:03:15 +0100 |
|---|---|---|
| committer | T-Aji <tolujbd2@gmail.com> | 2024-08-22 11:03:15 +0100 |
| commit | 21229b09564befcd58363ed7bc1774bbb457ee4b (patch) | |
| tree | dd768b23047afe9f7a87c0b8066eb0ff009da6da /tests | |
| parent | 548b8678e4d5f725e086f0e4eb115c9aa11b55be (diff) | |
| download | de-project-bentley-21229b09564befcd58363ed7bc1774bbb457ee4b.tar.gz de-project-bentley-21229b09564befcd58363ed7bc1774bbb457ee4b.zip | |
passing TestCreateDimCurrency
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/test_fact_sales_order.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/test_fact_sales_order.py b/tests/test_fact_sales_order.py index 13196d5..82845d7 100644 --- a/tests/test_fact_sales_order.py +++ b/tests/test_fact_sales_order.py @@ -1,4 +1,4 @@ -from src.fact_sales_order import create_dim_design, create_dim_staff +from src.fact_sales_order import create_dim_design, create_dim_staff, create_dim_currency import pandas as pd class TestCreateDimDesign: @@ -37,4 +37,21 @@ class TestCreateDimStaff: expected_df = pd.DataFrame(data=expected_d) expected_result = expected_df.copy() assert result.equals(expected_result) + +class TestCreateDimCurrency: + def test_dim_currency_returns_dataframe(self): + d = {"currency_id": [1, 2, 3], "currency_code": ["USD", "EUR", "GBP"]} + test_df = {"currency": pd.DataFrame(data=d)} + result = create_dim_currency(test_df) + assert isinstance(result, pd.DataFrame) + + def test_dim_currency_returns_columns_and_values(self): + d = {"currency_id": [1, 2, 3], "currency_code": ["USD", "EUR", "GBP"]} + test_df = {"currency": pd.DataFrame(data=d)} + result = create_dim_currency(test_df) + expected_d = {"currency_id": [1, 2, 3], "currency_code": ["USD", "EUR", "GBP"], "currency_name": ["US Dollar", "Euro", "Pound"]} + expected_df = pd.DataFrame(data=expected_d) + expected_result = expected_df.copy() + assert result.equals(expected_result) +
\ No newline at end of file |
