chg: Enable more tests

pull/434/head
Raphaël Vinot 2019-08-05 16:53:32 +02:00
parent 9b7d547f14
commit 549e3a5a84
1 changed files with 4 additions and 7 deletions

View File

@ -909,8 +909,7 @@ class TestComprehensive(unittest.TestCase):
self.assertTrue(k in csv[0]) self.assertTrue(k in csv[0])
finally: finally:
# FIXME Publish is async, if we delete the event too fast, we have an empty one. # Mostly solved -> https://github.com/MISP/MISP/issues/4886
# https://github.com/MISP/MISP/issues/4886
time.sleep(5) time.sleep(5)
# Delete event # Delete event
self.admin_misp_connector.delete_event(first.id) self.admin_misp_connector.delete_event(first.id)
@ -1128,7 +1127,7 @@ class TestComprehensive(unittest.TestCase):
for ref in peo.ObjectReference: for ref in peo.ObjectReference:
r = self.user_misp_connector.add_object_reference(ref) r = self.user_misp_connector.add_object_reference(ref)
# FIXME: https://github.com/MISP/MISP/issues/4866 # FIXME: https://github.com/MISP/MISP/issues/4866
# self.assertEqual(r.object_uuid, peo.uuid, r.to_json()) self.assertEqual(r.object_uuid, peo.uuid, r.to_json())
r = self.user_misp_connector.add_object(first.id, fo) r = self.user_misp_connector.add_object(first.id, fo)
obj_attrs = r.get_attributes_by_relation('ssdeep') obj_attrs = r.get_attributes_by_relation('ssdeep')
@ -1136,7 +1135,7 @@ class TestComprehensive(unittest.TestCase):
self.assertEqual(r.name, 'file', r) self.assertEqual(r.name, 'file', r)
r = self.user_misp_connector.add_object_reference(fo.ObjectReference[0]) r = self.user_misp_connector.add_object_reference(fo.ObjectReference[0])
# FIXME: https://github.com/MISP/MISP/issues/4866 # FIXME: https://github.com/MISP/MISP/issues/4866
# self.assertEqual(r.object_uuid, fo.uuid, r.to_json()) self.assertEqual(r.object_uuid, fo.uuid, r.to_json())
self.assertEqual(r.referenced_uuid, peo.uuid, r.to_json()) self.assertEqual(r.referenced_uuid, peo.uuid, r.to_json())
r = self.user_misp_connector.delete_object_reference(r.id) r = self.user_misp_connector.delete_object_reference(r.id)
self.assertEqual(r['message'], 'ObjectReference deleted') self.assertEqual(r['message'], 'ObjectReference deleted')
@ -1545,7 +1544,6 @@ class TestComprehensive(unittest.TestCase):
event = self.user_misp_connector.get_event(first.id, pythonify=True) event = self.user_misp_connector.get_event(first.id, pythonify=True)
self.assertEqual(event.attributes[3].value, '9.9.9.9') self.assertEqual(event.attributes[3].value, '9.9.9.9')
self.assertFalse(event.attributes[3].to_ids) self.assertFalse(event.attributes[3].to_ids)
# keep disable_background_processing enabled => returns the same ???? FIXME
r_wl = self.user_misp_connector.freetext(first.id, '8.8.8.8 foo@bar.de', adhereToWarninglists=True, r_wl = self.user_misp_connector.freetext(first.id, '8.8.8.8 foo@bar.de', adhereToWarninglists=True,
distribution=2, returnMetaAttributes=False, distribution=2, returnMetaAttributes=False,
kw_params={'disable_background_processing': 0}) kw_params={'disable_background_processing': 0})
@ -1558,8 +1556,7 @@ class TestComprehensive(unittest.TestCase):
self.assertTrue(isinstance(r, list)) self.assertTrue(isinstance(r, list))
self.assertTrue(isinstance(r[0]['types'], dict)) self.assertTrue(isinstance(r[0]['types'], dict))
finally: finally:
# NOTE: required, or the attributes are inserted *after* the event is deleted # Mostly solved https://github.com/MISP/MISP/issues/4886
# FIXME: https://github.com/MISP/MISP/issues/4886
time.sleep(10) time.sleep(10)
# Delete event # Delete event
self.admin_misp_connector.delete_event(first.id) self.admin_misp_connector.delete_event(first.id)