diff --git a/tests/test_offline.py b/tests/test_offline.py index dc1a54a..f25c353 100644 --- a/tests/test_offline.py +++ b/tests/test_offline.py @@ -47,6 +47,7 @@ class TestOffline(unittest.TestCase): m.register_uri('DELETE', self.domain + 'events/3', json={'errors': ['Invalid event'], 'message': 'Invalid event', 'name': 'Invalid event', 'url': '/events/3'}) m.register_uri('DELETE', self.domain + 'attributes/2', json={'message': 'Attribute deleted.'}) m.register_uri('GET', self.domain + 'events/index/searchtag:1', json=self.search_index_result) + m.register_uri('GET', self.domain + 'events/index/searchtag:ecsirt:malicious-code=%22ransomware%22', json=self.search_index_result) def test_getEvent(self, m): self.initURI(m) @@ -134,11 +135,17 @@ class TestOffline(unittest.TestCase): json.dumps(misp_event, cls=EncodeUpdate) json.dumps(misp_event, cls=EncodeFull) - def test_searchIndexByTag (self, m): + def test_searchIndexByTagId (self, m): self.initURI(m) pymisp = PyMISP(self.domain, self.key) response = pymisp.search_index(tag="1") self.assertEqual(response['response'],self.search_index_result) + + def test_searchIndexByTagName (self, m): + self.initURI(m) + pymisp = PyMISP(self.domain, self.key) + response = pymisp.search_index(tag='ecsirt:malicious-code="ransomware"') + self.assertEqual(response['response'],self.search_index_result) if __name__ == '__main__': unittest.main()