fix: Do not run PDF Export tests on python < 3.6

pull/370/head
Raphaël Vinot 2019-03-12 16:05:03 +01:00
parent 9d2251cb38
commit b82d3c25de
1 changed files with 10 additions and 9 deletions

View File

@ -7,17 +7,20 @@ import time
import unittest
from pymisp import MISPEvent
from pymisp.tools import reportlab_generator
manual_testing = False
if sys.version_info < (3, 6):
try:
from pymisp.tools import reportlab_generator
except ImportError:
if sys.version_info < (3, 6):
print('This test suite requires Python 3.6+, breaking.')
sys.exit(0)
else:
from pymisp import reportlab_generator
else:
raise
class TestMISPEvent(unittest.TestCase):
class TestPDFExport(unittest.TestCase):
def setUp(self):
self.maxDiff = None
@ -35,7 +38,6 @@ class TestMISPEvent(unittest.TestCase):
self.moduleconfig = ["MISP_base_url_for_dynamic_link", "MISP_name_for_metadata", "Activate_textual_description",
"Activate_galaxy_description", "Activate_related_events", "Activate_internationalization_fonts", "Custom_fonts_path"]
def init_event(self):
self.mispevent.info = 'This is a test'
self.mispevent.distribution = 1
@ -409,7 +411,6 @@ class TestMISPEvent(unittest.TestCase):
config[self.moduleconfig[4]] = True
config[self.moduleconfig[5]] = True
file_nb = str(len(os.listdir(self.test_batch_folder)))
i = 0
t = time.time()