]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: tests: fix tests by mocking progress service 29048/head
authorRicardo Dias <rdias@suse.com>
Mon, 15 Jul 2019 15:12:36 +0000 (16:12 +0100)
committerRicardo Dias <rdias@suse.com>
Wed, 17 Jul 2019 10:50:51 +0000 (11:50 +0100)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
src/pybind/mgr/dashboard/tests/test_rest_tasks.py

index bad16b746b26cc80f635c8979af0263a0c9eb61d..41c1a3852077c9a6707723972c2a4fb0d87cb446 100644 (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
index 191ef812934fb2970a8959cf1398f91ecc403fdd..44bce050a741eed03c937f3697b9d587345c717e 100644 (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