Skip to content

Commit 67017d2

Browse files
committed
move docs to basic
1 parent c79cc34 commit 67017d2

File tree

2 files changed

+90
-91
lines changed

2 files changed

+90
-91
lines changed

tests/functional/adapter/test_basic.py

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,22 @@
1+
import os
2+
13
import pytest
4+
from dbt.tests.adapter.basic.expected_catalog import (
5+
base_expected_catalog,
6+
expected_references_catalog,
7+
no_stats,
8+
)
29
from dbt.tests.adapter.basic.files import incremental_not_schema_change_sql
310
from dbt.tests.adapter.basic.test_adapter_methods import BaseAdapterMethod
411
from dbt.tests.adapter.basic.test_base import BaseSimpleMaterializations
12+
from dbt.tests.adapter.basic.test_docs_generate import (
13+
BaseDocsGenerate,
14+
BaseDocsGenReferences,
15+
ref_models__docs_md,
16+
ref_models__ephemeral_copy_sql,
17+
ref_models__schema_yml,
18+
ref_sources__schema_yml,
19+
)
520
from dbt.tests.adapter.basic.test_empty import BaseEmpty
621
from dbt.tests.adapter.basic.test_ephemeral import BaseEphemeral
722
from dbt.tests.adapter.basic.test_generic_tests import BaseGenericTests
@@ -74,3 +89,78 @@ class TestValidateConnectionSQLServer(BaseValidateConnection):
7489

7590
class TestTableMatSQLServer(BaseTableMaterialization):
7691
pass
92+
93+
94+
class TestDocsGenerateSQLServer(BaseDocsGenerate):
95+
@staticmethod
96+
@pytest.fixture(scope="class")
97+
def dbt_profile_target_update():
98+
return {"schema_authorization": "{{ env_var('DBT_TEST_USER_1') }}"}
99+
100+
@pytest.fixture(scope="class")
101+
def expected_catalog(self, project):
102+
return base_expected_catalog(
103+
project,
104+
role=os.getenv("DBT_TEST_USER_1"),
105+
id_type="int",
106+
text_type="varchar",
107+
time_type="datetime",
108+
view_type="VIEW",
109+
table_type="BASE TABLE",
110+
model_stats=no_stats(),
111+
)
112+
113+
114+
class TestDocsGenReferencesSQLServer(BaseDocsGenReferences):
115+
@staticmethod
116+
@pytest.fixture(scope="class")
117+
def dbt_profile_target_update():
118+
return {"schema_authorization": "{{ env_var('DBT_TEST_USER_1') }}"}
119+
120+
@pytest.fixture(scope="class")
121+
def expected_catalog(self, project):
122+
return expected_references_catalog(
123+
project,
124+
role=os.getenv("DBT_TEST_USER_1"),
125+
id_type="int",
126+
text_type="varchar",
127+
time_type="datetime",
128+
bigint_type="int",
129+
view_type="VIEW",
130+
table_type="BASE TABLE",
131+
model_stats=no_stats(),
132+
)
133+
134+
@pytest.fixture(scope="class")
135+
def models(self):
136+
ref_models__ephemeral_summary_sql_no_order_by = """
137+
{{
138+
config(
139+
materialized = "table"
140+
)
141+
}}
142+
143+
select first_name, count(*) as ct from {{ref('ephemeral_copy')}}
144+
group by first_name
145+
"""
146+
147+
ref_models__view_summary_sql_no_order_by = """
148+
{{
149+
config(
150+
materialized = "view"
151+
)
152+
}}
153+
154+
select first_name, ct from {{ref('ephemeral_summary')}}
155+
"""
156+
157+
return {
158+
"schema.yml": ref_models__schema_yml,
159+
"sources.yml": ref_sources__schema_yml,
160+
# order by not allowed in VIEWS
161+
"view_summary.sql": ref_models__view_summary_sql_no_order_by,
162+
# order by not allowed in CTEs
163+
"ephemeral_summary.sql": ref_models__ephemeral_summary_sql_no_order_by,
164+
"ephemeral_copy.sql": ref_models__ephemeral_copy_sql,
165+
"docs.md": ref_models__docs_md,
166+
}

tests/functional/adapter/test_docs.py

Lines changed: 0 additions & 91 deletions
This file was deleted.

0 commit comments

Comments
 (0)