diff --git a/tests/testlive_comprehensive.py b/tests/testlive_comprehensive.py index 323b3fb..19c0a24 100644 --- a/tests/testlive_comprehensive.py +++ b/tests/testlive_comprehensive.py @@ -542,11 +542,21 @@ class TestComprehensive(unittest.TestCase): obj = MISPObject('file') obj.add_attribute('filename', 'foo') first.add_object(obj) + obj = MISPObject('file') + obj.add_attribute('filename', 'bar') + first.add_object(obj) first = self.user_misp_connector.add_event(first) r = self.user_misp_connector.delete_attribute(first.attributes[0].uuid) self.assertEqual(r['message'], 'Attribute deleted.') r = self.user_misp_connector.delete_object(first.objects[0].uuid) self.assertEqual(r['message'], 'Object deleted') + r = self.user_misp_connector.search(event_id=first.id, deleted=[0, 1], pythonify=True) + self.assertTrue(isinstance(r[0], MISPEvent)) + self.assertEqual(len(r[0].objects), 2) + self.assertTrue(r[0].objects[0].deleted) + self.assertFalse(r[0].objects[1].deleted) + self.assertEqual(len(r[0].attributes), 1) + self.assertTrue(r[0].attributes[0].deleted) r = self.user_misp_connector.delete_event(first.uuid) self.assertEqual(r['message'], 'Event deleted.') finally: