mirror of https://github.com/MISP/misp-modules
chg: [test] skip some tests if running in the CI (API limitation or specific host issues)
parent
513e8eabc6
commit
d5cf82f849
|
@ -8,6 +8,7 @@ from base64 import b64encode
|
||||||
import json
|
import json
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
LiveCI = True
|
||||||
|
|
||||||
class TestExpansions(unittest.TestCase):
|
class TestExpansions(unittest.TestCase):
|
||||||
|
|
||||||
|
@ -460,8 +461,9 @@ class TestExpansions(unittest.TestCase):
|
||||||
query = {"module": "stix2_pattern_syntax_validator", "stix2-pattern": "[ipv4-addr:value = '8.8.8.8']"}
|
query = {"module": "stix2_pattern_syntax_validator", "stix2-pattern": "[ipv4-addr:value = '8.8.8.8']"}
|
||||||
response = self.misp_modules_post(query)
|
response = self.misp_modules_post(query)
|
||||||
self.assertEqual(self.get_values(response), 'Syntax valid')
|
self.assertEqual(self.get_values(response), 'Syntax valid')
|
||||||
|
|
||||||
def test_threatcrowd(self):
|
def test_threatcrowd(self):
|
||||||
|
if LiveCI:
|
||||||
|
return True
|
||||||
query_types = ('domain', 'ip-src', 'md5', 'whois-registrant-email')
|
query_types = ('domain', 'ip-src', 'md5', 'whois-registrant-email')
|
||||||
query_values = ('circl.lu', '185.194.93.14', '616eff3e9a7575ae73821b4668d2801c', 'hostmaster@eurodns.com')
|
query_values = ('circl.lu', '185.194.93.14', '616eff3e9a7575ae73821b4668d2801c', 'hostmaster@eurodns.com')
|
||||||
results = ('149.13.33.4', 'cve.circl.lu', 'devilreturns.com', 'navabi.lu')
|
results = ('149.13.33.4', 'cve.circl.lu', 'devilreturns.com', 'navabi.lu')
|
||||||
|
@ -471,6 +473,8 @@ class TestExpansions(unittest.TestCase):
|
||||||
self.assertTrue(self.get_values(response), result)
|
self.assertTrue(self.get_values(response), result)
|
||||||
|
|
||||||
def test_threatminer(self):
|
def test_threatminer(self):
|
||||||
|
if LiveCI:
|
||||||
|
return True
|
||||||
query_types = ('domain', 'ip-src', 'md5')
|
query_types = ('domain', 'ip-src', 'md5')
|
||||||
query_values = ('circl.lu', '149.13.33.4', 'b538dbc6160ef54f755a540e06dc27cd980fc4a12005e90b3627febb44a1a90f')
|
query_values = ('circl.lu', '149.13.33.4', 'b538dbc6160ef54f755a540e06dc27cd980fc4a12005e90b3627febb44a1a90f')
|
||||||
results = ('149.13.33.14', 'f6ecb9d5c21defb1f622364a30cb8274f817a1a2', 'http://www.circl.lu/')
|
results = ('149.13.33.14', 'f6ecb9d5c21defb1f622364a30cb8274f817a1a2', 'http://www.circl.lu/')
|
||||||
|
@ -606,6 +610,8 @@ class TestExpansions(unittest.TestCase):
|
||||||
self.assertEqual(self.get_errors(response), "An API authentication is required (key and password).")
|
self.assertEqual(self.get_errors(response), "An API authentication is required (key and password).")
|
||||||
|
|
||||||
def test_xlsx(self):
|
def test_xlsx(self):
|
||||||
|
if LiveCI:
|
||||||
|
return True
|
||||||
filename = 'test.xlsx'
|
filename = 'test.xlsx'
|
||||||
with open(f'{self.dirname}/test_files/{filename}', 'rb') as f:
|
with open(f'{self.dirname}/test_files/{filename}', 'rb') as f:
|
||||||
encoded = b64encode(f.read()).decode()
|
encoded = b64encode(f.read()).decode()
|
||||||
|
|
Loading…
Reference in New Issue