mirror of https://github.com/MISP/PyMISP
parent
f248a8bfff
commit
d428858f1e
|
@ -2973,7 +2973,7 @@ class PyMISP:
|
||||||
logger.debug(response.text)
|
logger.debug(response.text)
|
||||||
if expect_json:
|
if expect_json:
|
||||||
raise PyMISPUnexpectedResponse(f'Unexpected response from server: {response.text}')
|
raise PyMISPUnexpectedResponse(f'Unexpected response from server: {response.text}')
|
||||||
if lenient_response_type and not response.headers['Accept'].startswith('application/json'):
|
if lenient_response_type and not response.headers['Content-Type'].startswith('application/json'):
|
||||||
return response.text
|
return response.text
|
||||||
if not response.content:
|
if not response.content:
|
||||||
# Empty response
|
# Empty response
|
||||||
|
|
|
@ -1818,6 +1818,11 @@ class TestComprehensive(unittest.TestCase):
|
||||||
event_get = MISPEvent()
|
event_get = MISPEvent()
|
||||||
event_get.from_dict(**r)
|
event_get.from_dict(**r)
|
||||||
self.assertDictEqual(event.to_dict(), event_get.to_dict())
|
self.assertDictEqual(event.to_dict(), event_get.to_dict())
|
||||||
|
r = self.user_misp_connector.direct_call('events/restSearch', data={"returnFormat": "csv",
|
||||||
|
"type": {"AND": ["campaign-name", "threat-actor"]},
|
||||||
|
"category": "Attribution", "includeEventUuid": 1})
|
||||||
|
self.assertTrue(r.startswith('uuid,event_id,category,type,value'))
|
||||||
|
|
||||||
finally:
|
finally:
|
||||||
self.admin_misp_connector.delete_event(event)
|
self.admin_misp_connector.delete_event(event)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue