add: Test cases for reworked passive dns and ssl modules

pull/360/head
chrisr3d 2019-12-17 15:19:29 +01:00
parent 5f90ae776f
commit 3f7ee7c1a2
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 34 additions and 0 deletions

View File

@ -93,6 +93,40 @@ class TestExpansions(unittest.TestCase):
response = self.misp_modules_post(query)
self.assertEqual(self.get_values(response), '1es14c7qlb5cyhlmuekctxlgc1fv2ti9da fraudolent bitcoin address')
def test_circl_passivedns(self):
module_name = "circl_passivedns"
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), 'passive-dns')
except Exception:
self.assertTrue(self.get_errors(response).startswith('There is an authentication error'))
else:
self.assertTrue(self.get_errors(response).startswith('CIRCL Passive DNS authentication is incomplete'))
def test_circl_passivessl(self):
module_name = "circl_passivessl"
query = {"module": module_name,
"attribute": {"type": "",
"value": "",
"uuid": ""},
"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), 'x509')
except Exception:
self.assertTrue(self.get_errors(response).startswith('There is an authentication error'))
else:
self.assertTrue(self.get_errors(response).startswith('CIRCL Passive SSL authentication is incomplete'))
def test_countrycode(self):
query = {"module": "countrycode", "domain": "www.circl.lu"}
response = self.misp_modules_post(query)