]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: clean-up python unit tests
authorErnesto Puerta <epuertat@redhat.com>
Fri, 19 Jul 2019 15:23:56 +0000 (17:23 +0200)
committerErnesto Puerta <epuertat@redhat.com>
Fri, 16 Aug 2019 13:24:31 +0000 (15:24 +0200)
commitf4cbe8965f83af7db4d7b7ea4b26e532a5308e91
tree3965eccacee0fc271ec498bab3af133df0f884f4
parent3bdf181ffe7781842e4789f537520ef5824647c3
mgr/dashboard: clean-up python unit tests

Fix pylint issues.

Refactor JwtManager check to avoid code duplication (found by pylint
when --jobs=1).

Fix issue with DashboardException.code property, using abs() on
potentially None attribute.

Disables Doctests in services/rbd.py that are actually integration tests
(they check the value of rbd.RBD_FEATURES_NAME_MAPPING). Ideally, these
kind of tests should be explicitly executed in an integration testing
stage, rather that unit-testing. Disabled tests have been prepended with
@DISABLEDOCTEST token.

Fixes: https://tracker.ceph.com/issues/40487
Signed-off-by: Ernesto Puerta <epuertat@redhat.com>
16 files changed:
src/pybind/mgr/dashboard/controllers/__init__.py
src/pybind/mgr/dashboard/controllers/auth.py
src/pybind/mgr/dashboard/controllers/rbd_mirroring.py
src/pybind/mgr/dashboard/controllers/saml2.py
src/pybind/mgr/dashboard/exceptions.py
src/pybind/mgr/dashboard/plugins/__init__.py
src/pybind/mgr/dashboard/plugins/feature_toggles.py
src/pybind/mgr/dashboard/plugins/interfaces.py
src/pybind/mgr/dashboard/plugins/lru_cache.py
src/pybind/mgr/dashboard/plugins/pluggy.py
src/pybind/mgr/dashboard/plugins/ttl_cache.py
src/pybind/mgr/dashboard/services/auth.py
src/pybind/mgr/dashboard/services/ceph_service.py
src/pybind/mgr/dashboard/services/ganesha.py
src/pybind/mgr/dashboard/services/rbd.py
src/pybind/mgr/dashboard/tests/__init__.py