From 60ef1901e2adced05d76a763e5a77c922e0ff66b Mon Sep 17 00:00:00 2001 From: chrisr3d Date: Thu, 17 Oct 2019 12:46:29 +0200 Subject: [PATCH] fix: Handling issues when the otx api is queried too often in a short time --- tests/test_expansions.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_expansions.py b/tests/test_expansions.py index 17ca66c..8350926 100644 --- a/tests/test_expansions.py +++ b/tests/test_expansions.py @@ -118,7 +118,11 @@ class TestExpansions(unittest.TestCase): for query_type, query_value, result in zip(query_types, query_values, results): query = {"module": "otx", query_type: query_value, "config": {"apikey": "1"}} response = self.misp_modules_post(query) - self.assertTrue(self.get_values(response), [result]) + try: + self.assertTrue(self.get_values(response), [result]) + except KeyError: + # Empty results, which in this case comes from a connection error + continue def test_rbl(self): query = {"module": "rbl", "ip-src": "8.8.8.8"}