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

Commit 3f2614a

Browse files
committed
cleanup and formatter
1 parent 2d63e94 commit 3f2614a

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

tests/test_dbt.py

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import json
21
import os
32

43
from data_diff.diff_tables import Algorithm
@@ -11,7 +10,6 @@
1110
DbtParser,
1211
RUN_RESULTS_PATH,
1312
MANIFEST_PATH,
14-
PROFILES_FILE,
1513
PROJECT_FILE,
1614
DiffVars,
1715
)
@@ -154,10 +152,7 @@ def test_set_project_dict(self, mock_open, mock_yaml_parse):
154152

155153
def test_set_connection_snowflake_success(self):
156154
expected_driver = "snowflake"
157-
expected_credentials = {
158-
"user": "user",
159-
"password": "password"
160-
}
155+
expected_credentials = {"user": "user", "password": "password"}
161156
mock_self = Mock()
162157
mock_self._get_connection_creds.return_value = (expected_credentials, expected_driver)
163158

@@ -171,9 +166,7 @@ def test_set_connection_snowflake_success(self):
171166

172167
def test_set_connection_snowflake_no_password(self):
173168
expected_driver = "snowflake"
174-
expected_credentials = {
175-
"user": "user"
176-
}
169+
expected_credentials = {"user": "user"}
177170
mock_self = Mock()
178171
mock_self._get_connection_creds.return_value = (expected_credentials, expected_driver)
179172

@@ -185,10 +178,10 @@ def test_set_connection_snowflake_no_password(self):
185178
def test_set_connection_bigquery_success(self):
186179
expected_driver = "bigquery"
187180
expected_credentials = {
188-
"method": "oauth",
189-
"project": "a_project",
190-
"dataset": "a_dataset",
191-
}
181+
"method": "oauth",
182+
"project": "a_project",
183+
"dataset": "a_dataset",
184+
}
192185
mock_self = Mock()
193186
mock_self._get_connection_creds.return_value = (expected_credentials, expected_driver)
194187

@@ -202,10 +195,10 @@ def test_set_connection_bigquery_success(self):
202195
def test_set_connection_bigquery_not_oauth(self):
203196
expected_driver = "bigquery"
204197
expected_credentials = {
205-
"method": "not_oauth",
206-
"project": "a_project",
207-
"dataset": "a_dataset",
208-
}
198+
"method": "not_oauth",
199+
"project": "a_project",
200+
"dataset": "a_dataset",
201+
}
209202

210203
mock_self = Mock()
211204
mock_self._get_connection_creds.return_value = (expected_credentials, expected_driver)
@@ -300,7 +293,6 @@ def test_get_connection_no_credentials(self, mock_file):
300293
with self.assertRaises(ValueError):
301294
_, _ = DbtParser._get_connection_creds(mock_self)
302295

303-
304296
profile_yaml_no_target_credentials = """
305297
a_profile:
306298
outputs:
@@ -336,6 +328,7 @@ def test_get_connection_no_type(self, mock_file):
336328
with self.assertRaises(ValueError):
337329
_, _ = DbtParser._get_connection_creds(mock_self)
338330

331+
339332
class TestDbtDiffer(unittest.TestCase):
340333
# These two integration tests can be used to test a real diff
341334
# export DATA_DIFF_DBT_PROJ=/path/to/a/dbt/project

0 commit comments

Comments
 (0)