aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_dataframes.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_dataframes.py')
-rw-r--r--tests/test_dataframes.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/tests/test_dataframes.py b/tests/test_dataframes.py
index 785a3fd..ff282eb 100644
--- a/tests/test_dataframes.py
+++ b/tests/test_dataframes.py
@@ -72,8 +72,10 @@ class TestCreateDimStaff:
"email_address": ["Hello", "Bye"],
"department_id": ["Hello", "Bye"],
}
+
test_df = {"staff": pd.DataFrame(
data=d), "department": pd.DataFrame(data=d2)}
+
result = create_dim_staff(test_df)
expected_d = {
"staff_id": ["Hello", "Bye"],
@@ -92,6 +94,7 @@ class TestCreatePaymentType:
def test_create_dim_payment_type_returns_correct_columns_and_values(self):
d = {"payment_type_id": ["Hello", "Bye"],
"payment_type_name": ["Hello", "Bye"]}
+
test_df = {"payment_type": pd.DataFrame(data=d)}
result = create_dim_payment_type(test_df)
expected_columns = ["payment_type_id", "payment_type_name"]
@@ -190,6 +193,7 @@ class TestCreateDimDate:
df_three = pd.DataFrame(
data={"updated_date": dt(2022, 5, 17),
"created_date": dt(2023, 5, 13)},
+
index=[0],
)
expected_df = pd.DataFrame(
@@ -223,6 +227,7 @@ class TestCreateDimDate:
expected_df, axis="columns").all(axis=None)
+
class TestCreateDimLocation:
def test_returns_correct_columns_lo(self):
dict_df = {
@@ -230,6 +235,7 @@ class TestCreateDimLocation:
data=[["some_time", "some_other_time", 1, "SE18 9QO"]],
columns=["created_at", "last_updated",
"address_id", "postal_code"],
+
)
}
result = create_dim_location(dict_df)
@@ -259,7 +265,6 @@ class TestCreateFactPayment:
"payment": pd.DataFrame(
data=[
[
- << << << < HEAD
dt.strptime(
"2022-11-03 14:20:49.962846", "%Y-%m-%d %H:%M:%S.%f"
),
@@ -269,13 +274,6 @@ class TestCreateFactPayment:
1,
"SE18 9QO",
"2020-07-16",
- == == ===
- dt(2020, 5, 17, 6, 15, 20),
- dt(2020, 5, 20, 8, 19, 30),
- 1,
- "SE18 9QO",
- "2020-7-16",
- >>>>>> > 5db3f61(style: format code with Autopep8, Black and Ruff Formatter)
]
],
columns=[
@@ -304,10 +302,6 @@ class TestCreateFactPayment:
for col in expected_cols:
-<< << << < HEAD
+
if "_date" or "_time" in col:
assert result[col].dtype == "O"
-== == == =
-if "date" in col:
- assert result[col].dtype == "datetime64[ns]"
->>>>>> > 5db3f61(style: format code with Autopep8, Black and Ruff Formatter)
git.ajschof.me — hosted by ajschofield — powered by cgit