mirror of https://github.com/MISP/PyMISP
fix: error vs errors key
parent
10ccd637d9
commit
a3108f7689
|
@ -69,7 +69,7 @@ class ExpandedPyMISP(PyMISP):
|
|||
# The server returns a json message with the error details
|
||||
error_message = response.json()
|
||||
logger.error(f'Something went wrong ({response.status_code}): {error_message}')
|
||||
return {'error': (response.status_code, error_message)}
|
||||
return {'errors': (response.status_code, error_message)}
|
||||
|
||||
# At this point, we had no error.
|
||||
|
||||
|
@ -87,7 +87,7 @@ class ExpandedPyMISP(PyMISP):
|
|||
if not len(response.content):
|
||||
# Empty response
|
||||
logger.error('Got an empty response.')
|
||||
return {'error': 'The response is empty.'}
|
||||
return {'errors': 'The response is empty.'}
|
||||
return response.text
|
||||
|
||||
def get_event(self, event_id: int):
|
||||
|
|
|
@ -755,7 +755,7 @@ class TestComprehensive(unittest.TestCase):
|
|||
second = self.user_misp_connector.add_event(second)
|
||||
|
||||
response = self.user_misp_connector.fast_publish(first.id, alert=False)
|
||||
self.assertEqual(response['errors'][0][1]['message'], 'You do not have permission to use this functionality.')
|
||||
self.assertEqual(response['errors'][1]['message'], 'You do not have permission to use this functionality.')
|
||||
|
||||
# Default search, attribute with to_ids == True
|
||||
first.attributes[0].to_ids = True
|
||||
|
|
Loading…
Reference in New Issue