Skip to content

Commit

Permalink
Add basic test
Browse files Browse the repository at this point in the history
  • Loading branch information
LennartKloppenburg committed Oct 18, 2023
1 parent 0364ea3 commit 9b0e6e3
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/operators/test_virtualenv.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,28 @@ def test_run_command(
assert dbt_deps[0][0][0] == dbt_cmd[0][0][0]
assert dbt_cmd[0][0][1] == "do-something"
assert mock_execute.call_count == 2

@patch("airflow.hooks.base.BaseHook.get_connection")
def test_supply_virtualenv_dir_flag(
mock_get_connection,
):
mock_get_connection.return_value = Connection(
conn_id="fake_conn",
conn_type="postgres",
host="fake_host",
port=5432,
login="fake_login",
password="fake_password",
schema="fake_schema",
)
venv_operator = DbtVirtualenvBaseOperator(
profile_config=profile_config,
task_id="fake_task",
install_deps=True,
project_dir="./dev/dags/dbt/jaffle_shop",
py_system_site_packages=False,
py_requirements=["dbt-postgres==1.6.0b1"],
emit_datasets=False,
virtualenv_dir="mock-venv",
)
assert venv_operator.venv_dbt_path == "mock-venv/bin/dbt"

0 comments on commit 9b0e6e3

Please sign in to comment.