Skip to content

Commit fbac882

Browse files
committed
test: update validation tests to match refactoring
1 parent 66c1390 commit fbac882

2 files changed

Lines changed: 3 additions & 34 deletions

File tree

.coveragerc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,4 @@
22
omit =
33
data_pipeline/prototypes/*
44
data_pipeline/shared/table_configs.py
5-
data_pipeline/stages/*
65
*/__init__.py

tests/stages/test_validate_raw_data.py

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -131,47 +131,17 @@ def test_log_info_appends_only_to_info(empty_report):
131131
# ------------------------------------------------------------
132132

133133

134-
def test_base_validation_fails_on_missing_allowed_column(
134+
def test_base_validation_fails_on_missing_required_column(
135135
empty_report,
136136
valid_customers_df,
137137
):
138-
df = valid_customers_df.drop(columns="customer_city")
138+
df = valid_customers_df.drop(columns="customer_state")
139139
ok = run_base_validations(
140140
df,
141141
"df_customers",
142142
["customer_id"],
143143
[
144144
"customer_id",
145-
"customer_zip_code_prefix",
146-
"customer_city",
147-
"customer_state",
148-
],
149-
empty_report,
150-
)
151-
152-
assert ok is False
153-
assert len(empty_report["errors"]) == 1
154-
assert any(
155-
"df_customers: missing allowed column(s): ['customer_city']" in error
156-
for error in empty_report["errors"]
157-
)
158-
159-
160-
def test_base_validation_fails_on_invalid_extra_column(
161-
empty_report,
162-
valid_customers_df,
163-
):
164-
165-
df = valid_customers_df
166-
df["extra_column"] = ["extra", "extra"]
167-
ok = run_base_validations(
168-
df,
169-
"df_customers",
170-
["customer_id"],
171-
[
172-
"customer_id",
173-
"customer_zip_code_prefix",
174-
"customer_city",
175145
"customer_state",
176146
],
177147
empty_report,
@@ -180,7 +150,7 @@ def test_base_validation_fails_on_invalid_extra_column(
180150
assert ok is False
181151
assert len(empty_report["errors"]) == 1
182152
assert any(
183-
"df_customers: non-allowed extra column(s): ['extra_column']" in error
153+
"df_customers: missing required column(s): ['customer_state']" in error
184154
for error in empty_report["errors"]
185155
)
186156

0 commit comments

Comments
 (0)