Skip to content

Commit

Permalink
added test
Browse files Browse the repository at this point in the history
  • Loading branch information
pushrbx committed Dec 8, 2023
1 parent 45b6c96 commit b781743
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions integration_tests/tests/test_exposure_schema_validity.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,37 @@ def test_exposure_schema_validity_correct_columns_and_invalid_type(
assert test_result["status"] == "fail"


@pytest.mark.skip_targets(["spark"])
def test_exposure_schema_validity_invalid_type_name_present_in_error(
test_id: str, dbt_project: DbtProject
):
DBT_TEST_ARGS = {
"node": "models.exposures_test",
"columns": [{"name": "order_id", "dtype": "numeric", "data_type": "numeric"}],
"exposures": {
"ZOMG": {
"meta": {
"referenced_columns": [
{"column_name": "order_id", "data_type": "string"}
]
},
"url": "http://bla.com",
"name": "ZOMG",
"depends_on": {"nodes": ["models.exposures_test"]},
}
},
}
test_result = dbt_project.test(
test_id, DBT_TEST_NAME, DBT_TEST_ARGS, columns=[dict(name="bla")], as_model=True
)

assert (
"different data type for the column order_id string vs numeric"
in test_result["test_results_query"]
)
assert test_result["status"] == "fail"


@pytest.mark.skip_targets(["spark"])
def test_exposure_schema_validity_correct_columns_and_missing_type(
test_id: str, dbt_project: DbtProject
Expand Down

0 comments on commit b781743

Please sign in to comment.