new: [tests] Test for local tags

pull/877/head
Raphaël Vinot 2022-11-17 09:17:18 +01:00
parent 661bf6ad14
commit 6b1303355f
1 changed files with 6 additions and 0 deletions

View File

@ -1262,8 +1262,14 @@ class TestComprehensive(unittest.TestCase):
self.assertTrue('successfully' in r['message'].lower() and f'({second.id})' in r['message'], r['message']) self.assertTrue('successfully' in r['message'].lower() and f'({second.id})' in r['message'], r['message'])
second = self.user_misp_connector.get_event(second.id, pythonify=True) second = self.user_misp_connector.get_event(second.id, pythonify=True)
self.assertTrue('generic_tag_test' == second.tags[0].name) self.assertTrue('generic_tag_test' == second.tags[0].name)
# # Test local tag, shouldn't update the timestamp
old_ts = second.timestamp
r = self.admin_misp_connector.tag(second, 'generic_tag_test_local', local=True)
second = self.user_misp_connector.get_event(second.id, pythonify=True)
self.assertEqual(old_ts, second.timestamp)
r = self.admin_misp_connector.untag(second, 'generic_tag_test') r = self.admin_misp_connector.untag(second, 'generic_tag_test')
r = self.admin_misp_connector.untag(second, 'generic_tag_test_local')
self.assertTrue(r['message'].endswith(f'successfully removed from Event({second.id}).'), r['message']) self.assertTrue(r['message'].endswith(f'successfully removed from Event({second.id}).'), r['message'])
second = self.user_misp_connector.get_event(second.id, pythonify=True) second = self.user_misp_connector.get_event(second.id, pythonify=True)
self.assertFalse(second.tags) self.assertFalse(second.tags)