Skip to content

Commit

Permalink
remove redundant test, use creds.is_motherduck to determine if user a…
Browse files Browse the repository at this point in the history
…gent should have been passed or not
  • Loading branch information
guenp committed Feb 9, 2024
1 parent f599b24 commit 8f28262
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions tests/functional/plugins/test_motherduck.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,7 @@ def test_motherduck_user_agent(dbt_profile_target):
creds = DuckDBCredentials(path=test_path)
with mock.patch("dbt.adapters.duckdb.environments.duckdb.connect") as mock_connect:
Environment.initialize_db(creds)
mock_connect.assert_called_with(test_path, **kwargs)


def test_no_motherduck_user_agent(dbt_profile_target):
test_path = ":memory:"
creds = DuckDBCredentials(path=test_path)
with mock.patch("dbt.adapters.duckdb.environments.duckdb.connect") as mock_connect:
Environment.initialize_db(creds)
mock_connect.assert_called_with(test_path, read_only=False, config = {})
if creds.is_motherduck:
mock_connect.assert_called_with(test_path, **kwargs)
else:
mock_connect.assert_called_with(test_path, read_only=False, config = {})

0 comments on commit 8f28262

Please sign in to comment.