From: Aashish Sharma Date: Mon, 6 Jul 2020 10:34:51 +0000 (+0530) Subject: mgr/dashboard: increase API test coverage in API controllers X-Git-Tag: v15.2.5~42^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=27c73db92542f92b4ee2606e339db4e17d05c84f;p=ceph.git mgr/dashboard: increase API test coverage in API controllers Added test cases for the missing endpoints Fixes: https://tracker.ceph.com/issues/45901 Signed-off-by: Aashish Sharma (cherry picked from commit bba8134aaed2b0616376007320cba961f6ee67b0) Conflicts: src/pybind/mgr/dashboard/controllers/osd.py - Resolved manually. --- diff --git a/src/pybind/mgr/dashboard/controllers/osd.py b/src/pybind/mgr/dashboard/controllers/osd.py index 1a0777b32d4..2731ad0ffcd 100644 --- a/src/pybind/mgr/dashboard/controllers/osd.py +++ b/src/pybind/mgr/dashboard/controllers/osd.py @@ -157,7 +157,7 @@ class Osd(RESTController): @raise_if_no_orchestrator @handle_orchestrator_error('osd') @osd_task('delete', {'svc_id': '{svc_id}'}) - def delete(self, svc_id, preserve_id=None, force=None): # pragma: no cover - requires realtime env + def delete(self, svc_id, preserve_id=None, force=None): # pragma: no cover replace = False check = False try: diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py index 2f8dfdb876f..669049fc233 100644 --- a/src/pybind/mgr/dashboard/module.py +++ b/src/pybind/mgr/dashboard/module.py @@ -12,6 +12,7 @@ import socket import tempfile import threading import time + from mgr_module import MgrModule, MgrStandbyModule, Option, CLIWriteCommand from mgr_util import get_default_addr, ServerConfigException, verify_tls_files, \ create_self_signed_cert @@ -290,8 +291,9 @@ class Module(MgrModule, CherryPyConfig): if 'COVERAGE_ENABLED' in os.environ: import coverage - __cov = coverage.Coverage(config_file="{}/.coveragerc".format - (os.path.dirname(__file__)),data_suffix=True) + __cov = coverage.Coverage(config_file="{}/.coveragerc" + .format(os.path.dirname(__file__)), + data_suffix=True) __cov.start() cherrypy.engine.subscribe('after_request', __cov.save)