]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
1 # -*- coding: utf-8 -*-
3 from ..tests
import CLICommandTestMixin
, ControllerTestCase
6 class TestPluginDebug(ControllerTestCase
, CLICommandTestMixin
):
9 # pylint: disable=protected-access
10 cls
.setup_controllers([])
15 def test_debug_disabled(self
):
16 self
.exec_cmd('debug', action
='disable')
18 self
._get
('/api/unexisting_controller')
19 self
.assertStatus(404)
21 data
= self
.json_body()
22 self
.assertGreater(len(data
), 0)
23 self
.assertNotIn('traceback', data
)
24 self
.assertNotIn('version', data
)
25 self
.assertIn('request_id', data
)
27 def test_debug_enabled(self
):
28 self
.exec_cmd('debug', action
='enable')
30 self
._get
('/api/unexisting_controller')
31 self
.assertStatus(404)
33 data
= self
.json_body()
34 self
.assertGreater(len(data
), 0)
35 self
.assertIn('traceback', data
)
36 self
.assertIn('version', data
)
37 self
.assertIn('request_id', data
)