Update test_expansions.py

pull/554/head
Rambatla Venkat Rao 2022-02-12 11:01:54 +05:30 committed by GitHub
parent 3856f9fe1d
commit e7645a195a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 0 deletions

View File

@ -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"}