chg: [tests] Remove travis exceptions.

pull/426/head
Raphaël Vinot 2019-07-19 17:26:59 +02:00
parent 55c2bff26b
commit 1ec7ec37d9
1 changed files with 31 additions and 41 deletions

View File

@ -33,13 +33,11 @@ except ImportError:
try:
from keys import url, key
verifycert = False
travis_run = True
except ImportError as e:
print(e)
url = 'https://localhost:8443'
key = 'K5yV0CcxdnklzDfCKlnPniIxrMX41utQ2dG13zZ3'
verifycert = False
travis_run = False
urllib3.disable_warnings()
@ -479,8 +477,6 @@ class TestComprehensive(unittest.TestCase):
def test_default_distribution(self):
'''The default distributions on the VM are This community only for the events and Inherit from event for attr/obj)'''
if travis_run:
return
first = self.create_simple_event()
del first.distribution
o = first.add_object(name='file')
@ -670,8 +666,6 @@ class TestComprehensive(unittest.TestCase):
self.assertEqual(events[0].id, second.id)
self.assertEqual(len(events[0].attributes), 5)
if not travis_run:
# FIXME: This is failing on travis for no discernable reason...
events = self.user_misp_connector.search(eventid=second.id, enforce_warninglist=True, pythonify=True)
self.assertEqual(len(events), 1)
self.assertEqual(events[0].id, second.id)
@ -893,7 +887,6 @@ class TestComprehensive(unittest.TestCase):
first.add_attribute('ip-src', '8.8.8.8')
try:
first = self.user_misp_connector.add_event(first)
if not travis_run:
stix = self.user_misp_connector.search(return_format='stix', eventid=first.id)
found = re.findall('8.8.8.8', stix)
self.assertTrue(found)
@ -1129,7 +1122,6 @@ class TestComprehensive(unittest.TestCase):
for tax in taxonomies:
if tax.namespace == list_name_test:
break
if not travis_run:
r = self.admin_misp_connector.get_taxonomy(tax.id, pythonify=True)
self.assertEqual(r.namespace, list_name_test)
self.assertTrue('enabled' in r)
@ -1192,7 +1184,6 @@ class TestComprehensive(unittest.TestCase):
self.assertFalse(r['Noticelist']['enabled'], r)
def test_galaxies(self):
if not travis_run:
# Make sure we're up-to-date
r = self.admin_misp_connector.update_galaxies()
self.assertEqual(r['name'], 'Galaxies updated.')
@ -1212,7 +1203,6 @@ class TestComprehensive(unittest.TestCase):
first = self.create_simple_event()
try:
first = self.user_misp_connector.add_event(first)
if not travis_run:
r = self.admin_misp_connector.push_event_to_ZMQ(first.id)
self.assertEqual(r['message'], 'Event published to ZMQ')
finally: