Skip to content

Commit

Permalink
Add test for generic test unrendered_config
Browse files Browse the repository at this point in the history
  • Loading branch information
gshank committed Dec 18, 2024
1 parent a175793 commit b9be1ac
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tests/functional/defer_state/test_unrendered_config.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import pytest

from dbt.tests.util import run_dbt


dbt_project_update = """
models:
my_dbt_project:
+materialized: table
tests:
+store_failures: true
"""

foo_sql = """
select 1 as id
"""

schema_yml = """
models:
- name: foo
columns:
- name: id
tests:
- unique
"""

class TestGenericTestUnrenderedConfig():
@pytest.fixture(scope="class")
def project_config_update(self):
return dbt_project_update

@pytest.fixture(scope="class")
def models(self):
return {
"foo.sql": foo_sql,
"schema.yml": schema_yml,
}

def test_unrendered_config(self, project):
manifest = run_dbt(["parse"])
assert manifest
print(f"--- nodes: {manifest.nodes.keys()}")
test_node_id = 'test.test.unique_foo_id.fa8c520a2e'
test_node = manifest.nodes[test_node_id]
assert test_node.unrendered_config == {"store_failures": True}

0 comments on commit b9be1ac

Please sign in to comment.