mirror of
https://github.com/ceph/ceph
synced 2024-12-14 23:46:28 +00:00
ed2b4e7a56
Fixes: https://tracker.ceph.com/issues/44851 Signed-off-by: Shreya Sharma <shreyasharma.ss305@gmail.com> Signed-off-by: Avan Thakkar <athakkar@redhat.com>
37 lines
1.3 KiB
Python
37 lines
1.3 KiB
Python
import time
|
|
|
|
from .helper import DashboardTestCase
|
|
|
|
|
|
class FeedbackTest(DashboardTestCase):
|
|
|
|
@classmethod
|
|
def setUpClass(cls):
|
|
super().setUpClass()
|
|
cls._ceph_cmd(['mgr', 'module', 'enable', 'feedback'])
|
|
time.sleep(10)
|
|
|
|
def test_create_api_key(self):
|
|
self._post('/api/feedback/api_key', {'api_key': 'testapikey'}, version='0.1')
|
|
self.assertStatus(201)
|
|
|
|
def test_get_api_key(self):
|
|
response = self._get('/api/feedback/api_key', version='0.1')
|
|
self.assertStatus(200)
|
|
self.assertEqual(response, 'testapikey')
|
|
|
|
def test_remove_api_key(self):
|
|
self._delete('/api/feedback/api_key', version='0.1')
|
|
self.assertStatus(204)
|
|
|
|
def test_issue_tracker_create_with_invalid_key(self):
|
|
self._post('/api/feedback', {'api_key': 'invalidapikey', 'description': 'test',
|
|
'project': 'dashboard', 'subject': 'sub', 'tracker': 'bug'},
|
|
version='0.1')
|
|
self.assertStatus(400)
|
|
|
|
def test_issue_tracker_create_with_invalid_params(self):
|
|
self._post('/api/feedback', {'api_key': '', 'description': 'test', 'project': 'xyz',
|
|
'subject': 'testsub', 'tracker': 'invalid'}, version='0.1')
|
|
self.assertStatus(400)
|