add: [tests] Test case for the APIVoid module

pull/360/head
chrisr3d 2019-12-18 23:04:36 +01:00
parent 7945d060ff
commit 0d3e61dc4d
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 18 additions and 0 deletions

View File

@ -78,6 +78,24 @@ class TestExpansions(unittest.TestCase):
except AssertionError: except AssertionError:
self.assertTrue(self.get_values(response).startswith('185.255.79.90 IS NOT listed by OSINT.digitalside.it.')) self.assertTrue(self.get_values(response).startswith('185.255.79.90 IS NOT listed by OSINT.digitalside.it.'))
def test_apivoid(self):
module_name = "apivoid"
query = {"module": module_name,
"attribute": {"type": "domain",
"value": "circl.lu",
"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), 'dns-record')
except Exception:
self.assertTrue(self.get_errors(response).startswith('You do not have enough APIVoid credits'))
else:
response = self.misp_modules_post(query)
self.assertEqual(self.get_errors(response), 'An API key for APIVoid is required.')
def test_bgpranking(self): def test_bgpranking(self):
query = {"module": "bgpranking", "AS": "13335"} query = {"module": "bgpranking", "AS": "13335"}
response = self.misp_modules_post(query) response = self.misp_modules_post(query)