mgr/dashboard: tests: fix tests by mocking progress service

Signed-off-by: Ricardo Dias <rdias@suse.com>
This commit is contained in:
Ricardo Dias 2019-07-15 16:12:36 +01:00
parent f374e274a8
commit 5cd8b3bb36
No known key found for this signature in database
GPG Key ID: 74390C579BD37B68
2 changed files with 10 additions and 0 deletions

View File

@ -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

View File

@ -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