From: Kiefer Chang Date: Fri, 19 Jul 2019 07:30:36 +0000 (+0800) Subject: mgr/dashboard: fix tox test failure X-Git-Tag: v15.1.0~2168^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F29125%2Fhead;p=ceph.git mgr/dashboard: fix tox test failure `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 --- diff --git a/src/pybind/mgr/dashboard/tests/test_pool.py b/src/pybind/mgr/dashboard/tests/test_pool.py index 16d7d7b12a64..157f2720f9e8 100644 --- a/src/pybind/mgr/dashboard/tests/test_pool.py +++ b/src/pybind/mgr/dashboard/tests/test_pool.py @@ -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',