test_add_service_with_config unit test fixes
@@ -477,14 +477,10 @@ class TestService:
}
}
}
-
- mock = MagicMock()
- attrs = {"plugin_info.side_effect": [mock_plugin_info]}
- mock.configure_mock(**attrs)
server.Server.scheduler = Scheduler(None, None)
storage_client_mock = MagicMock(StorageClientAsync)
c_mgr = ConfigurationManager(storage_client_mock)
- with patch('builtins.__import__', return_value=mock):
+ with patch.object(common, 'load_and_fetch_python_plugin_info', side_effect=[mock_plugin_info]):
with patch.object(connect, 'get_storage_async', return_value=storage_client_mock):
with patch.object(c_mgr, 'get_category_all_items', return_value=self.async_mock(None)) as patch_get_cat_info:
with patch.object(storage_client_mock, 'query_tbl_with_payload', side_effect=q_result):
