@@ -663,38 +663,6 @@ def test_diff_is_not_cloud(self, mock_print, mock_dbt_parser, mock_cloud_diff, m
663
663
mock_local_diff .assert_called_once_with (expected_diff_vars )
664
664
mock_print .assert_not_called ()
665
665
666
- @patch ("data_diff.dbt._get_diff_vars" )
667
- @patch ("data_diff.dbt._local_diff" )
668
- @patch ("data_diff.dbt._cloud_diff" )
669
- @patch ("data_diff.dbt_parser.DbtParser.__new__" )
670
- @patch ("data_diff.dbt.rich.print" )
671
- def test_diff_no_prod_configs (
672
- self , mock_print , mock_dbt_parser , mock_cloud_diff , mock_local_diff , mock_get_diff_vars
673
- ):
674
- mock_dbt_parser_inst = Mock ()
675
- mock_dbt_parser .return_value = mock_dbt_parser_inst
676
- mock_model = Mock ()
677
- expected_dbt_vars_dict = {
678
- "datasource_id" : 1 ,
679
- }
680
-
681
- mock_dbt_parser_inst .get_models .return_value = [mock_model ]
682
- mock_dbt_parser_inst .get_datadiff_variables .return_value = expected_dbt_vars_dict
683
- connection = None
684
- threads = None
685
- where = "a_string"
686
- expected_diff_vars = DiffVars (["dev" ], ["prod" ], ["pks" ], connection , threads , where )
687
- mock_get_diff_vars .return_value = expected_diff_vars
688
- with self .assertRaises (ValueError ):
689
- dbt_diff (is_cloud = False )
690
-
691
- mock_dbt_parser_inst .get_models .assert_called_once ()
692
- mock_dbt_parser_inst .set_connection .assert_called_once ()
693
- mock_dbt_parser_inst .get_primary_keys .assert_not_called ()
694
- mock_cloud_diff .assert_not_called ()
695
- mock_local_diff .assert_not_called ()
696
- mock_print .assert_not_called ()
697
-
698
666
@patch ("data_diff.dbt._get_diff_vars" )
699
667
@patch ("data_diff.dbt._local_diff" )
700
668
@patch ("data_diff.dbt._cloud_diff" )
@@ -746,14 +714,12 @@ def test_diff_only_prod_schema(
746
714
where = "a_string"
747
715
expected_diff_vars = DiffVars (["dev" ], ["prod" ], ["pks" ], connection , threads , where )
748
716
mock_get_diff_vars .return_value = expected_diff_vars
749
- with self .assertRaises (ValueError ):
750
- dbt_diff (is_cloud = False )
717
+ dbt_diff (is_cloud = False )
751
718
752
719
mock_dbt_parser_inst .get_models .assert_called_once ()
753
720
mock_dbt_parser_inst .set_connection .assert_called_once ()
754
- mock_dbt_parser_inst .get_primary_keys .assert_not_called ()
755
721
mock_cloud_diff .assert_not_called ()
756
- mock_local_diff .assert_not_called ( )
722
+ mock_local_diff .assert_called_once_with ( expected_diff_vars )
757
723
mock_print .assert_not_called ()
758
724
759
725
@patch ("data_diff.dbt._initialize_api" )
0 commit comments