mirror of https://github.com/MISP/PyMISP
parent
6395951637
commit
cdcbe9bf32
|
@ -2226,7 +2226,7 @@ class PyMISP:
|
|||
return self._csv_to_dict(normalized_response_text) # type: ignore
|
||||
else:
|
||||
return normalized_response_text
|
||||
elif return_format == 'stix-xml':
|
||||
elif return_format in ['stix-xml', 'text']:
|
||||
return self._check_response(response)
|
||||
|
||||
normalized_response = self._check_json_response(response)
|
||||
|
|
|
@ -1152,6 +1152,19 @@ class TestComprehensive(unittest.TestCase):
|
|||
self.admin_misp_connector.delete_event(first)
|
||||
self.admin_misp_connector.delete_event(second)
|
||||
|
||||
def test_search_text(self):
|
||||
first = self.create_simple_event()
|
||||
first.add_attribute('ip-src', '8.8.8.8')
|
||||
first.publish()
|
||||
try:
|
||||
first = self.user_misp_connector.add_event(first)
|
||||
self.admin_misp_connector.publish(first)
|
||||
text = self.user_misp_connector.search(return_format='text', eventid=first.id)
|
||||
self.assertEqual('8.8.8.8', text.strip())
|
||||
finally:
|
||||
# Delete event
|
||||
self.admin_misp_connector.delete_event(first)
|
||||
|
||||
def test_search_stix(self):
|
||||
first = self.create_simple_event()
|
||||
first.add_attribute('ip-src', '8.8.8.8')
|
||||
|
|
Loading…
Reference in New Issue