Skip to content
This repository was archived by the owner on May 17, 2024. It is now read-only.

Commit 7949396

Browse files
committed
Fix test_dbt.py
1 parent eb94762 commit 7949396

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

tests/test_dbt.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import json
22
import os
33

4+
import yaml
45
from data_diff.diff_tables import Algorithm
56
from .test_cli import run_datadiff_cli
67

@@ -140,7 +141,7 @@ def test_get_models_no_success(self, mock_manifest_parser, mock_run_parser, mock
140141
mock_run_parser.assert_called_once_with(run_results={})
141142
mock_manifest_parser.assert_called_once_with(manifest={})
142143

143-
@patch("data_diff.dbt.yaml.safe_load")
144+
@patch("yaml.safe_load")
144145
@patch("builtins.open", new_callable=mock_open, read_data="key:\n value")
145146
def test_set_project_dict(self, mock_open, mock_yaml_parse):
146147
expected_dict = {"key1": "value1"}
@@ -152,7 +153,7 @@ def test_set_project_dict(self, mock_open, mock_yaml_parse):
152153
self.assertEqual(mock_self.project_dict, expected_dict)
153154
mock_open.assert_called_once_with(PROJECT_FILE)
154155

155-
@patch("data_diff.dbt.yaml.safe_load")
156+
@patch("yaml.safe_load")
156157
@patch("builtins.open", new_callable=mock_open, read_data="key:\n value")
157158
def test_set_connection_snowflake(self, mock_open_file, mock_yaml_parse):
158159
expected_driver = "snowflake"
@@ -182,7 +183,7 @@ def test_set_connection_snowflake(self, mock_open_file, mock_yaml_parse):
182183
mock_open_file.assert_called_once_with(PROFILES_FILE)
183184
mock_yaml_parse.assert_called_once_with(mock_open_file())
184185

185-
@patch("data_diff.dbt.yaml.safe_load")
186+
@patch("yaml.safe_load")
186187
@patch("builtins.open", new_callable=mock_open, read_data="key:\n value")
187188
def test_set_connection_snowflake_no_password(self, mock_open_file, mock_yaml_parse):
188189
expected_driver = "snowflake"
@@ -205,7 +206,7 @@ def test_set_connection_snowflake_no_password(self, mock_open_file, mock_yaml_pa
205206
mock_yaml_parse.assert_called_once_with(mock_open_file())
206207
self.assertNotIsInstance(mock_self.connection, dict)
207208

208-
@patch("data_diff.dbt.yaml.safe_load")
209+
@patch("yaml.safe_load")
209210
@patch("builtins.open", new_callable=mock_open, read_data="key:\n value")
210211
def test_set_connection_bigquery(self, mock_open_file, mock_yaml_parse):
211212
expected_driver = "bigquery"
@@ -239,7 +240,7 @@ def test_set_connection_bigquery(self, mock_open_file, mock_yaml_parse):
239240
mock_open_file.assert_called_once_with(PROFILES_FILE)
240241
mock_yaml_parse.assert_called_once_with(mock_open_file())
241242

242-
@patch("data_diff.dbt.yaml.safe_load")
243+
@patch("yaml.safe_load")
243244
@patch("builtins.open", new_callable=mock_open, read_data="key:\n value")
244245
def test_set_connection_bigquery_not_oauth(self, mock_open_file, mock_yaml_parse):
245246
expected_driver = "bigquery"
@@ -271,7 +272,7 @@ def test_set_connection_bigquery_not_oauth(self, mock_open_file, mock_yaml_parse
271272
mock_yaml_parse.assert_called_once_with(mock_open_file())
272273
self.assertNotIsInstance(mock_self.connection, dict)
273274

274-
@patch("data_diff.dbt.yaml.safe_load")
275+
@patch("yaml.safe_load")
275276
@patch("builtins.open", new_callable=mock_open, read_data="key:\n value")
276277
def test_set_connection_key_error(self, mock_open_file, mock_yaml_parse):
277278
profiles_dict = {
@@ -298,7 +299,7 @@ def test_set_connection_key_error(self, mock_open_file, mock_yaml_parse):
298299
mock_yaml_parse.assert_called_once_with(mock_open_file())
299300
self.assertNotIsInstance(mock_self.connection, dict)
300301

301-
@patch("data_diff.dbt.yaml.safe_load")
302+
@patch("yaml.safe_load")
302303
@patch("builtins.open", new_callable=mock_open, read_data="key:\n value")
303304
def test_set_connection_not_implemented(self, mock_open_file, mock_yaml_parse):
304305
expected_driver = "not_implemented"

0 commit comments

Comments
 (0)