Skip to content

Commit

Permalink
Adding
Browse files Browse the repository at this point in the history
  • Loading branch information
Sachin-Thakur committed Nov 6, 2023
1 parent 825e18a commit dbb2512
Showing 1 changed file with 27 additions and 50 deletions.
77 changes: 27 additions & 50 deletions tests/functional/adapter/constraints/test_constraints.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,43 +130,43 @@
"""


class TestIncrementalConstraintsRollback(BaseIncrementalConstraintsRollback):

@pytest.fixture(scope="class")
def models(self):
return {
"my_model.sql": my_model_sql,
"constraints_schema.yml": model_schema_yml,
}
@pytest.fixture(scope="class")
def expected_error_messages(self):
return [""]
# class TestIncrementalConstraintsRollback(BaseIncrementalConstraintsRollback):

# @pytest.fixture(scope="class")
# def models(self):
# return {
# "my_model.sql": my_model_sql,
# "constraints_schema.yml": model_schema_yml,
# }
# @pytest.fixture(scope="class")
# def expected_error_messages(self):
# return [""]

@pytest.fixture(scope="class")
def expected_color(self):
return "red"
# @pytest.fixture(scope="class")
# def expected_color(self):
# return "red"

@pytest.fixture(scope="class")
def null_model_sql(self):
return my_model_with_nulls_sql
# @pytest.fixture(scope="class")
# def null_model_sql(self):
# return my_model_with_nulls_sql





class TestValidateSqlMethod(BaseValidateSqlMethod):
pass
# class TestValidateSqlMethod(BaseValidateSqlMethod):
# pass

class TestNullCompare(BaseNullCompare):
pass
# class TestNullCompare(BaseNullCompare):
# pass


class TestMixedNullCompare(BaseMixedNullCompare):
pass
# class TestMixedNullCompare(BaseMixedNullCompare):
# pass


class TestEquals(BaseEquals):
pass
# class TestEquals(BaseEquals):
# pass



Expand All @@ -175,35 +175,12 @@ class TestConstraintQuotedColumn(BaseConstraintQuotedColumn):
@pytest.fixture(scope="class")
def expected_sql(self):
return """
create table <model_identifier> include schema privileges as(select 'blue' as "from",1 as id,'2019-01-01' as date_day);
"""
create table <model_identifier> INCLUDE SCHEMA PRIVILEGES as ( select 'blue' as "from", 1 as id, '2019-01-01' as date_day ) ; """
pass

class TestModelConstraintsRuntimeEnforcement(BaseModelConstraintsRuntimeEnforcement):
@pytest.fixture(scope="class")
def expected_sql(self):
return """
create table <model_identifier> (
id integer not null,
color text,
date_day text,
primary key (id),
constraint strange_uniqueness_requirement unique (color, date_day),
foreign key (id) references <foreign_key_model_identifier> (id)
) ;
insert into <model_identifier>
(
select
id,
color,
date_day from
(
-- depends_on: <foreign_key_model_identifier>
select
'blue' as color,
1 as id,
'2019-01-01' as date_day
) as model_subq
)
;
create table <model_identifier> INCLUDE SCHEMA PRIVILEGES as ( -- depends_on: <foreign_key_model_identifier> select 'blue' as color, 1 as id, '2019-01-01' as date_day ) ;
"""

0 comments on commit dbb2512

Please sign in to comment.