@@ -178,7 +178,7 @@ def test_extract_scope_singleasic(self, mock_is_multi_asic):
178178 except jsonpointer .JsonPointerException :
179179 assert (not result )
180180
181- @patch ('generic_config_updater.change_applier .get_config_db_as_json' , autospec = True )
181+ @patch ('generic_config_updater.gu_common .get_config_db_as_json' , autospec = True )
182182 @patch ('generic_config_updater.change_applier.ConfigDBConnector' , autospec = True )
183183 def test_apply_change_default_scope (self , mock_ConfigDBConnector , mock_get_running_config ):
184184 # Setup mock for ConfigDBConnector
@@ -195,13 +195,13 @@ def test_apply_change_default_scope(self, mock_ConfigDBConnector, mock_get_runni
195195 change = MagicMock ()
196196
197197 # Call the apply method with the change object
198- current_config = copy .deepcopy (generic_config_updater .change_applier .get_config_db_as_json (scope = self ))
198+ current_config = copy .deepcopy (generic_config_updater .gu_common .get_config_db_as_json (scope = self ))
199199 current_config = applier .apply (current_config , change )
200200
201201 # Assert ConfigDBConnector called with the correct namespace
202202 mock_ConfigDBConnector .assert_called_once_with (use_unix_socket_path = True , namespace = "" )
203203
204- @patch ('generic_config_updater.change_applier .get_config_db_as_json' , autospec = True )
204+ @patch ('generic_config_updater.gu_common .get_config_db_as_json' , autospec = True )
205205 @patch ('generic_config_updater.change_applier.ConfigDBConnector' , autospec = True )
206206 def test_apply_change_given_scope (self , mock_ConfigDBConnector , mock_get_running_config ):
207207 # Setup mock for ConfigDBConnector
@@ -216,13 +216,13 @@ def test_apply_change_given_scope(self, mock_ConfigDBConnector, mock_get_running
216216 change = MagicMock ()
217217
218218 # Call the apply method with the change object
219- current_config = copy .deepcopy (generic_config_updater .change_applier .get_config_db_as_json (scope = "asic0" ))
219+ current_config = copy .deepcopy (generic_config_updater .gu_common .get_config_db_as_json (scope = "asic0" ))
220220 current_config = applier .apply (current_config , change )
221221
222222 # Assert ConfigDBConnector called with the correct scope
223223 mock_ConfigDBConnector .assert_called_once_with (use_unix_socket_path = True , namespace = "asic0" )
224224
225- @patch ('generic_config_updater.change_applier .get_config_db_as_json' , autospec = True )
225+ @patch ('generic_config_updater.gu_common .get_config_db_as_json' , autospec = True )
226226 @patch ('generic_config_updater.change_applier.ConfigDBConnector' , autospec = True )
227227 def test_apply_change_failure (self , mock_ConfigDBConnector , mock_get_running_config ):
228228 # Setup mock for ConfigDBConnector
@@ -240,12 +240,12 @@ def test_apply_change_failure(self, mock_ConfigDBConnector, mock_get_running_con
240240
241241 # Test the behavior when os.system fails
242242 with self .assertRaises (Exception ) as context :
243- current_config = copy .deepcopy (generic_config_updater .change_applier .get_config_db_as_json ())
243+ current_config = copy .deepcopy (generic_config_updater .gu_common .get_config_db_as_json ())
244244 current_config = applier .apply (current_config , change )
245245
246246 self .assertTrue ('Failed to get running config' in str (context .exception ))
247247
248- @patch ('generic_config_updater.change_applier .get_config_db_as_json' , autospec = True )
248+ @patch ('generic_config_updater.gu_common .get_config_db_as_json' , autospec = True )
249249 @patch ('generic_config_updater.change_applier.ConfigDBConnector' , autospec = True )
250250 def test_apply_patch_with_empty_tables_failure (self , mock_ConfigDBConnector , mock_get_running_config ):
251251 # Setup mock for ConfigDBConnector
@@ -271,7 +271,7 @@ def mock_get_empty_running_config_side_effect():
271271 # Prepare a change object or data that applier.apply would use, simulating a patch that requires non-empty tables
272272 change = MagicMock ()
273273
274- current_config = copy .deepcopy (generic_config_updater .change_applier .get_config_db_as_json ())
274+ current_config = copy .deepcopy (generic_config_updater .gu_common .get_config_db_as_json ())
275275
276276 # Apply the patch
277277 try :
0 commit comments