mirror of
https://github.com/ceph/ceph
synced 2025-02-19 08:57:27 +00:00
mgr/dashboard: tests: fix tests by mocking progress service
Signed-off-by: Ricardo Dias <rdias@suse.com>
This commit is contained in:
parent
f374e274a8
commit
5cd8b3bb36
@ -7,6 +7,7 @@ from . import ControllerTestCase
|
||||
from .. import mgr
|
||||
from ..controllers.summary import Summary
|
||||
from ..controllers.rbd_mirroring import RbdMirroringSummary
|
||||
from ..services import progress
|
||||
|
||||
|
||||
mock_list_servers = [{
|
||||
@ -67,6 +68,9 @@ class RbdMirroringSummaryControllerTest(ControllerTestCase):
|
||||
'(23d3751b897b31d2bda57aeaf01acb5ff3c4a9cd) ' \
|
||||
'nautilus (dev)'
|
||||
|
||||
progress.get_progress_tasks = mock.MagicMock()
|
||||
progress.get_progress_tasks.return_value = ([], [])
|
||||
|
||||
# pylint: disable=protected-access
|
||||
RbdMirroringSummary._cp_config['tools.authenticate.on'] = False
|
||||
Summary._cp_config['tools.authenticate.on'] = False
|
||||
|
@ -3,9 +3,12 @@
|
||||
|
||||
import time
|
||||
|
||||
import mock
|
||||
|
||||
from . import ControllerTestCase
|
||||
from ..controllers import Controller, RESTController, Task
|
||||
from ..controllers.task import Task as TaskController
|
||||
from ..services import progress
|
||||
from ..tools import NotificationQueue, TaskManager
|
||||
|
||||
|
||||
@ -48,6 +51,9 @@ class TaskControllerTest(ControllerTestCase):
|
||||
@classmethod
|
||||
def setup_server(cls):
|
||||
# pylint: disable=protected-access
|
||||
progress.get_progress_tasks = mock.MagicMock()
|
||||
progress.get_progress_tasks.return_value = ([], [])
|
||||
|
||||
NotificationQueue.start_queue()
|
||||
TaskManager.init()
|
||||
TaskTest._cp_config['tools.authenticate.on'] = False
|
||||
|
Loading…
Reference in New Issue
Block a user