]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix tox test failure 29125/head
authorKiefer Chang <kiefer.chang@suse.com>
Fri, 19 Jul 2019 07:30:36 +0000 (15:30 +0800)
committerKiefer Chang <kiefer.chang@suse.com>
Fri, 19 Jul 2019 07:36:06 +0000 (15:36 +0800)
`api/task` now also returns tasks in progress module.
Mock related function for tests.

Fixes: https://tracker.ceph.com/issues/40827
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
src/pybind/mgr/dashboard/tests/test_pool.py

index 16d7d7b12a641e9880eb5407f0f9f3f82e162553..157f2720f9e802b4e576b38747f560bf497aa274 100644 (file)
@@ -23,9 +23,10 @@ class PoolControllerTest(ControllerTestCase):
         Pool._cp_config['tools.authenticate.on'] = False
         cls.setup_controllers([Pool, Task])
 
+    @mock.patch('dashboard.services.progress.get_progress_tasks')
     @mock.patch('dashboard.controllers.pool.Pool._get')
     @mock.patch('dashboard.services.ceph_service.CephService.send_command')
-    def test_creation(self, send_command, _get):
+    def test_creation(self, send_command, _get, get_progress_tasks):
         _get.side_effect = [{
             'pool_name': 'test-pool',
             'pg_num': 64,
@@ -46,6 +47,7 @@ class PoolControllerTest(ControllerTestCase):
             time.sleep(3)
 
         send_command.side_effect = _send_cmd
+        get_progress_tasks.return_value = [], []
 
         self._task_post('/api/pool', {
             'pool': 'test-pool',