Skip to content

Commit

Permalink
add incremental model
Browse files Browse the repository at this point in the history
  • Loading branch information
emmyoop committed Mar 21, 2023
1 parent b7873fa commit cb93842
Showing 1 changed file with 22 additions and 19 deletions.
41 changes: 22 additions & 19 deletions tests/functional/adapter/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
)
from dbt.tests.adapter.constraints.fixtures import (
my_model_sql,
my_incremental_model_sql,
my_model_wrong_order_sql,
my_model_wrong_name_sql,
my_model_view_wrong_order_sql,
my_model_view_wrong_name_sql,
my_model_incremental_wrong_order_sql,
my_model_wrong_name_sql,
my_model_view_wrong_name_sql,
my_model_incremental_wrong_name_sql,
model_schema_yml,
)
Expand Down Expand Up @@ -110,19 +111,6 @@ def models(self):
}


class SetupBigQueryConstraintsRollback:
@pytest.fixture(scope="class")
def models(self):
return {
"my_model.sql": my_model_sql,
"constraints_schema.yml": constraints_yml,
}

@pytest.fixture(scope="class")
def expected_error_messages(self):
return ["Required field id cannot be null"]


class TestBigQueryTableConstraintsRuntimeDdlEnforcement(
BaseConstraintsRuntimeDdlEnforcement
):
Expand All @@ -139,11 +127,18 @@ def expected_sql(self, project):


class TestBigQueryTableConstraintsRollback(
SetupBigQueryConstraintsRollback,
BaseConstraintsRollback
):
pass
@pytest.fixture(scope="class")
def models(self):
return {
"my_model.sql": my_model_sql,
"constraints_schema.yml": constraints_yml,
}

@pytest.fixture(scope="class")
def expected_error_messages(self):
return ["Required field id cannot be null"]

class TestBigQueryIncrementalConstraintsRuntimeDdlEnforcement(
BaseIncrementalConstraintsRuntimeDdlEnforcement
Expand All @@ -161,7 +156,15 @@ def expected_sql(self, project):


class TestBigQueryIncrementalConstraintsRollback(
SetupBigQueryConstraintsRollback,
BaseIncrementalConstraintsRollback
):
pass
@pytest.fixture(scope="class")
def models(self):
return {
"my_model.sql": my_incremental_model_sql,
"constraints_schema.yml": constraints_yml,
}

@pytest.fixture(scope="class")
def expected_error_messages(self):
return ["Required field id cannot be null"]

0 comments on commit cb93842

Please sign in to comment.