Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Nov 19, 2024
1 parent 2a75dd4 commit 3f9ac00
Showing 1 changed file with 40 additions and 0 deletions.
40 changes: 40 additions & 0 deletions tests/functional/access/test_access.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,3 +470,43 @@ def test_dbt_project_access_config(self, project):
assert model_two.access == AccessType.Private
assert model_three.group == "marts"
assert model_three.access == AccessType.Public


models_yml = """
models:
- name: accounts
description: >
All accounts with whom we have done business. This is a very sensitive asset.
access: private
group: sales
columns:
- name: name
description: Name of the account.
tests:
- not_null
- unique
"""

accounts_sql = """
select "Jane" as name
"""


class TestGenericTestRestrictAccess:
@pytest.fixture(scope="class")
def models(self):
return {
"models.yml": models_yml,
"accounts.sql": accounts_sql,
}

@pytest.fixture(scope="class")
def project_config_update(self):
return {
"restrict-access": True,
}

def test_generic_tests(self, project):
run_dbt(["run"])
run_dbt(["test"])

0 comments on commit 3f9ac00

Please sign in to comment.