From 43a44f0693eba432439d26ea6289870566f160e6 Mon Sep 17 00:00:00 2001 From: Kiefer Chang Date: Fri, 19 Jul 2019 15:30:36 +0800 Subject: [PATCH] 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 --- src/pybind/mgr/dashboard/tests/test_pool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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', -- 2.47.3