Skip to content

Commit

Permalink
chg: [test] skip some tests if running in the CI (API limitation or s…
Browse files Browse the repository at this point in the history
…pecific host issues)
  • Loading branch information
adulau committed Apr 19, 2021
1 parent 513e8ea commit d5cf82f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_expansions.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import json
import os

LiveCI = True

class TestExpansions(unittest.TestCase):

Expand Down Expand Up @@ -460,8 +461,9 @@ def test_stix2_pattern_validator(self):
query = {"module": "stix2_pattern_syntax_validator", "stix2-pattern": "[ipv4-addr:value = '8.8.8.8']"}
response = self.misp_modules_post(query)
self.assertEqual(self.get_values(response), 'Syntax valid')

def test_threatcrowd(self):
if LiveCI:
return True
query_types = ('domain', 'ip-src', 'md5', 'whois-registrant-email')
query_values = ('circl.lu', '185.194.93.14', '616eff3e9a7575ae73821b4668d2801c', '[email protected]')
results = ('149.13.33.4', 'cve.circl.lu', 'devilreturns.com', 'navabi.lu')
Expand All @@ -471,6 +473,8 @@ def test_threatcrowd(self):
self.assertTrue(self.get_values(response), result)

def test_threatminer(self):
if LiveCI:
return True
query_types = ('domain', 'ip-src', 'md5')
query_values = ('circl.lu', '149.13.33.4', 'b538dbc6160ef54f755a540e06dc27cd980fc4a12005e90b3627febb44a1a90f')
results = ('149.13.33.14', 'f6ecb9d5c21defb1f622364a30cb8274f817a1a2', 'http://www.circl.lu/')
Expand Down Expand Up @@ -606,6 +610,8 @@ def test_xforceexchange(self):
self.assertEqual(self.get_errors(response), "An API authentication is required (key and password).")

def test_xlsx(self):
if LiveCI:
return True
filename = 'test.xlsx'
with open(f'{self.dirname}/test_files/{filename}', 'rb') as f:
encoded = b64encode(f.read()).decode()
Expand Down

0 comments on commit d5cf82f

Please sign in to comment.