-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
317f1e9
commit 6bf58e8
Showing
11 changed files
with
57 additions
and
524 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
import pytest | ||
import os | ||
import re | ||
import yaml | ||
|
||
from tests.functional.utils import run_dbt, run_dbt_and_capture | ||
|
||
MODELS__MODEL_SQL = """ | ||
seled 1 as id | ||
""" | ||
|
||
|
||
class BaseDebug: | ||
@pytest.fixture(scope="class") | ||
def models(self): | ||
return {"model.sql": MODELS__MODEL_SQL} | ||
|
||
@pytest.fixture(autouse=True) | ||
def capsys(self, capsys): | ||
self.capsys = capsys | ||
|
||
def assertGotValue(self, linepat, result): | ||
found = False | ||
output = self.capsys.readouterr().out | ||
for line in output.split("\n"): | ||
if linepat.match(line): | ||
found = True | ||
assert result in line | ||
if not found: | ||
with pytest.raises(Exception) as exc: | ||
msg = f"linepat {linepat} not found in stdout: {output}" | ||
assert msg in str(exc.value) | ||
|
||
def check_project(self, splitout, msg="ERROR invalid"): | ||
for line in splitout: | ||
if line.strip().startswith("dbt_project.yml file"): | ||
assert msg in line | ||
elif line.strip().startswith("profiles.yml file"): | ||
assert "ERROR invalid" not in line | ||
|
||
|
||
class BaseDebugProfileVariable(BaseDebug): | ||
@pytest.fixture(scope="class") | ||
def project_config_update(self): | ||
return {"config-version": 2, "profile": '{{ "te" ~ "st" }}'} | ||
|
||
|
||
class TestDebugPostgres(BaseDebug): | ||
def test_ok(self, project): | ||
result, log = run_dbt_and_capture(["debug"]) | ||
assert "ERROR" not in log | ||
|
||
|
||
class TestDebugProfileVariablePostgres(BaseDebugProfileVariable): | ||
pass |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.