diff --git a/tests/test_expansions.py b/tests/test_expansions.py index b8764f7..7459e99 100644 --- a/tests/test_expansions.py +++ b/tests/test_expansions.py @@ -293,6 +293,29 @@ class TestExpansions(unittest.TestCase): response = self.misp_modules_post(query) self.assertEqual(self.get_object(response), 'asn') + def test_ipqs_fraud_and_risk_scoring(self): + module_name = "ipqs_fraud_and_risk_scoring" + query = {"module": module_name, + "attribute": {"type": "domain", + "value": "noreply@ipqualityscore.com", + "uuid": "ea89a33b-4ab7-4515-9f02-922a0bee333d"}, + "config": {}} + if module_name in self.configs: + query['config'] = self.configs[module_name] + response = self.misp_modules_post(query) + try: + self.assertEqual(self.get_object(response), 'IPQS:) + except Exception: + self.assertIn( + self.get_errors(response), + ( + "Invalid or unauthorized key. Please check the API key and try again." + ) + ) + else: + response = self.misp_modules_post(query) + self.assertEqual(self.get_errors(response), 'An API key for IPQualityScore is required.') + def test_macaddess_io(self): module_name = 'macaddress_io' query = {"module": module_name, "mac-address": "44:38:39:ff:ef:57"}