Skip to content

Commit

Permalink
Missed PR fedback (#7642)
Browse files Browse the repository at this point in the history
(cherry picked from commit df23f68)
  • Loading branch information
iknox-fa committed May 17, 2023
1 parent 9804e67 commit 14e0152
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/functional/dependencies/test_local_dependency.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

from pathlib import Path
from unittest import mock
from contextlib import contextmanager

import dbt.semver
import dbt.config
Expand All @@ -16,6 +17,7 @@
from dbt.tests.util import (
check_relations_equal,
run_dbt,
run_dbt_and_capture,
)

models__dep_source = """
Expand Down Expand Up @@ -85,6 +87,16 @@
"""


@contextmanager
def up_one():
current_path = Path.cwd()
os.chdir("../")
try:
yield
finally:
os.chdir(current_path)


class BaseDependencyTest(object):
@pytest.fixture(scope="class")
def macros(self):
Expand Down Expand Up @@ -174,6 +186,16 @@ def test_no_dependency_paths(self, project):
assert len(results) == 2


class TestSimpleDependencyRelativePath(BaseDependencyTest):
def test_local_dependency_relative_path(self, project):
last_dir = Path(project.project_root).name
with up_one():
_, stdout = run_dbt_and_capture(["deps", "--project-dir", last_dir])
assert (
"Installed from <local @ local_dependency>" in stdout
), "Test output didn't contain expected string"


class TestMissingDependency(object):
@pytest.fixture(scope="class")
def models(self):
Expand Down

0 comments on commit 14e0152

Please sign in to comment.