]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
mgr/dashboard: Refactor Python unittests 34662/head
authorVolker Theile <vtheile@suse.com>
Wed, 6 Nov 2019 14:02:49 +0000 (15:02 +0100)
committerVolker Theile <vtheile@suse.com>
Tue, 21 Apr 2020 11:16:50 +0000 (13:16 +0200)
commit24d35991de9cc4bdd6306da1e8037602d1c50ae2
tree32dd3aba40a2bc85c5ae72da58d327221d9e0f6a
parentd4564d2be6b48dae15ae72d6423fd8f168e09f21
mgr/dashboard: Refactor Python unittests

* Make use of the KVStoreMockMixin class to get rid off duplicate code.
* Fake the index.html file to be able to run tests/test_home.py locally without building the frontend in production mode.
* Encapsulate helper functions in controllers/home.py, otherwise tests/test_feature_toggles.py need to fake the filesystem because load_controllers() will load the home.py controller and fail due missing files in the filesystem.

Signed-off-by: Volker Theile <vtheile@suse.com>
(cherry picked from commit e542255b04457df269587bc5639b14a935a125d3)

# Conflicts:
src/pybind/mgr/dashboard/requirements.txt
src/pybind/mgr/dashboard/tests/test_home.py
src/pybind/mgr/dashboard/tests/test_rgw_client.py
src/pybind/mgr/dashboard/controllers/__init__.py
src/pybind/mgr/dashboard/controllers/home.py
src/pybind/mgr/dashboard/requirements.txt
src/pybind/mgr/dashboard/tests/__init__.py
src/pybind/mgr/dashboard/tests/test_grafana.py
src/pybind/mgr/dashboard/tests/test_home.py
src/pybind/mgr/dashboard/tests/test_rgw_client.py