]>
git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
1 # -*- coding: utf-8 -*-
2 from __future__
import absolute_import
4 from . import CLICommandTestMixin
, ControllerTestCase
7 class TestPluginDebug(ControllerTestCase
, CLICommandTestMixin
):
10 # pylint: disable=protected-access
11 cls
.setup_controllers([])
16 def test_debug_disabled(self
):
17 self
.exec_cmd('debug', action
='disable')
19 self
._get
('/api/unexisting_controller')
20 self
.assertStatus(404)
22 data
= self
.json_body()
23 self
.assertGreater(len(data
), 0)
24 self
.assertNotIn('traceback', data
)
25 self
.assertNotIn('version', data
)
26 self
.assertIn('request_id', data
)
28 def test_debug_enabled(self
):
29 self
.exec_cmd('debug', action
='enable')
31 self
._get
('/api/unexisting_controller')
32 self
.assertStatus(404)
34 data
= self
.json_body()
35 self
.assertGreater(len(data
), 0)
36 self
.assertIn('traceback', data
)
37 self
.assertIn('version', data
)
38 self
.assertIn('request_id', data
)