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

Commit

Permalink
update for threads mocking
Browse files Browse the repository at this point in the history
  • Loading branch information
Sung Won Chung committed Nov 20, 2023
1 parent 6fc9900 commit 8fe43de
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions tests/test_dbt.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,7 @@ def test_diff_is_cloud(
where = "a_string"
config = TDatadiffConfig(prod_database="prod_db", prod_schema="prod_schema", datasource_id=1)
mock_dbt_parser_inst = Mock()
mock_dbt_parser_inst.threads = threads
mock_model = Mock()
mock_api.get_data_source.return_value = TCloudApiDataSource(id=1, type="snowflake", name="snowflake")
mock_initialize_api.return_value = mock_api
Expand Down Expand Up @@ -386,6 +387,7 @@ def test_diff_is_not_cloud(self, mock_print, mock_dbt_parser, mock_cloud_diff, m
threads = None
where = "a_string"
mock_dbt_parser_inst = Mock()
mock_dbt_parser_inst.threads = threads
mock_dbt_parser.return_value = mock_dbt_parser_inst
mock_model = Mock()
mock_dbt_parser_inst.get_models.return_value = [mock_model]
Expand Down Expand Up @@ -423,6 +425,7 @@ def test_diff_state_model_dne(
threads = None
where = "a_string"
mock_dbt_parser_inst = Mock()
mock_dbt_parser_inst.threads = threads
mock_dbt_parser.return_value = mock_dbt_parser_inst
mock_model = Mock()
mock_dbt_parser_inst.get_models.return_value = [mock_model]
Expand Down Expand Up @@ -460,6 +463,7 @@ def test_diff_only_prod_db(self, mock_print, mock_dbt_parser, mock_cloud_diff, m
threads = None
where = "a_string"
mock_dbt_parser_inst = Mock()
mock_dbt_parser_inst.threads = threads
mock_dbt_parser.return_value = mock_dbt_parser_inst
mock_model = Mock()
mock_dbt_parser_inst.get_models.return_value = [mock_model]
Expand Down Expand Up @@ -497,6 +501,7 @@ def test_diff_only_prod_schema(
threads = None
where = "a_string"
mock_dbt_parser_inst = Mock()
mock_dbt_parser_inst.threads = threads
mock_dbt_parser.return_value = mock_dbt_parser_inst
mock_model = Mock()
mock_dbt_parser_inst.get_models.return_value = [mock_model]
Expand Down Expand Up @@ -543,6 +548,7 @@ def test_diff_is_cloud_no_pks(
mock_model = Mock()
connection = {}
threads = None
mock_dbt_parser_inst.threads = threads
where = "a_string"
config = TDatadiffConfig(prod_database="prod_db", prod_schema="prod_schema", datasource_id=1)
mock_api = Mock()
Expand Down Expand Up @@ -584,6 +590,7 @@ def test_diff_not_is_cloud_no_pks(
threads = None
where = "a_string"
mock_dbt_parser_inst = Mock()
mock_dbt_parser_inst.threads = threads
mock_dbt_parser.return_value = mock_dbt_parser_inst
mock_model = Mock()
mock_dbt_parser_inst.get_models.return_value = [mock_model]
Expand Down

0 comments on commit 8fe43de

Please sign in to comment.