From 3ee7d8c67601bee658f1c0f488635796e5d7eb04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= Date: Tue, 7 Jan 2020 15:30:16 +0100 Subject: [PATCH] chg: Search with the STIX output returns a json STIX Was XML before. --- tests/testlive_comprehensive.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/testlive_comprehensive.py b/tests/testlive_comprehensive.py index 68e34d8..9b58c7e 100644 --- a/tests/testlive_comprehensive.py +++ b/tests/testlive_comprehensive.py @@ -993,8 +993,7 @@ class TestComprehensive(unittest.TestCase): try: first = self.user_misp_connector.add_event(first) stix = self.user_misp_connector.search(return_format='stix', eventid=first.id) - found = re.findall('8.8.8.8', stix) - self.assertTrue(found) + self.assertTrue(stix['related_packages'][0]['package']['incidents'][0]['related_indicators']['indicators'][0]['indicator']['observable']['object']['properties']['address_value']['value'], '8.8.8.8') stix2 = self.user_misp_connector.search(return_format='stix2', eventid=first.id) json.dumps(stix2, indent=2) self.assertEqual(stix2['objects'][-1]['pattern'], "[network-traffic:src_ref.type = 'ipv4-addr' AND network-traffic:src_ref.value = '8.8.8.8']")