new: Get Database Schema Diagnostic

Fix #492
pull/500/head
Raphaël Vinot 2019-11-11 14:28:12 +01:00
parent 204fd6ba8c
commit 8c2bbaa13c
2 changed files with 8 additions and 0 deletions

View File

@ -179,6 +179,10 @@ class ExpandedPyMISP(PyMISP):
response = self._prepare_request('POST', f'/servers/restartWorkers')
return self._check_response(response, expect_json=True)
def db_schema_diagnostic(self):
response = self._prepare_request('GET', f'/servers/dbSchemaDiagnostic')
return self._check_response(response, expect_json=True)
def toggle_global_pythonify(self):
self.global_pythonify = not self.global_pythonify

View File

@ -1561,6 +1561,10 @@ class TestComprehensive(unittest.TestCase):
self.assertEqual(entry.action, 'edit')
r = self.admin_misp_connector.update_user({'email': 'testusr@user.local'}, self.test_usr)
def test_db_schema(self):
diag = self.admin_misp_connector.db_schema_diagnostic()
self.assertEqual(diag['actual_db_version'], diag['expected_db_version'], diag)
def test_live_acl(self):
missing_acls = self.admin_misp_connector.remote_acl()
self.assertEqual(missing_acls, [], msg=missing_acls)