add: Added tests for some expansion modules without API key required

- More tests to come
pull/339/head
chrisr3d 2019-10-04 16:07:19 +02:00
parent 6801289175
commit a591138020
No known key found for this signature in database
GPG Key ID: 6BBED1B63A6D639F
1 changed files with 20 additions and 0 deletions

View File

@ -24,11 +24,31 @@ class TestExpansions(unittest.TestCase):
return data
return data['results'][0]['values']
def test_btc_steroids(self):
query = {"module": "btc_steroids", "btc": "1ES14c7qLb5CYhLMUekctxLgc1FV2Ti9DA"}
reponse = self.misp_modules_post(query)
self.assertTrue(self.get_values(response)[0].startswith('\n\nAddress:\t1ES14c7qLb5CYhLMUekctxLgc1FV2Ti9DA\nBalance:\t0.0000000000 BTC (+0.0005355700 BTC / -0.0005355700 BTC)'))
def test_btc_scam_check(self):
query = {"module": "btc_scam_check", "btc": "1ES14c7qLb5CYhLMUekctxLgc1FV2Ti9DA"}
response = slef.misp_modules_post(query)
self.assertEqual(self.get_values(response), '1es14c7qlb5cyhlmuekctxlgc1fv2ti9da fraudolent bitcoin address')
def test_countrycode(self):
query = {"module": "countrycode", "domain": "www.circl.lu"}
reponse = self.misp_modules_post(query)
self.assertEqual(self.get_values(response), ['Luxembourg'])
def test_cve(self):
query = {"module": "cve", "vulnerability": "CVE-2010-3333", "config": {"custom_API": "https://cve.circl.lu/api/cve/"}}
response = self.misp_modules_post(query)
self.assertTrue(self.get_values(response).startswith("Stack-based buffer overflow in Microsoft Office XP SP3, Office 2003 SP3"))
def test_dbl_spamhaus(self):
query = {"module": "dbl_spamhaus", "domain": "language.wikaba.com"}
response = self.misp_modules_post(query)
self.assertEqual(self.get_values(response), 'language.wikaba.com - abused legit malware')
def test_dns(self):
query = {"module": "dns", "hostname": "www.circl.lu", "config": {"nameserver": "8.8.8.8"}}
response = self.misp_modules_post(query)