mirror of https://github.com/MISP/PyMISP
fix: Do not run PDF Export tests on python < 3.6
parent
9d2251cb38
commit
b82d3c25de
|
@ -7,17 +7,20 @@ import time
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
from pymisp import MISPEvent
|
from pymisp import MISPEvent
|
||||||
from pymisp.tools import reportlab_generator
|
|
||||||
|
|
||||||
manual_testing = False
|
manual_testing = False
|
||||||
|
|
||||||
if sys.version_info < (3, 6):
|
try:
|
||||||
print('This test suite requires Python 3.6+, breaking.')
|
from pymisp.tools import reportlab_generator
|
||||||
sys.exit(0)
|
except ImportError:
|
||||||
else:
|
if sys.version_info < (3, 6):
|
||||||
from pymisp import reportlab_generator
|
print('This test suite requires Python 3.6+, breaking.')
|
||||||
|
sys.exit(0)
|
||||||
|
else:
|
||||||
|
raise
|
||||||
|
|
||||||
class TestMISPEvent(unittest.TestCase):
|
|
||||||
|
class TestPDFExport(unittest.TestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
self.maxDiff = None
|
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",
|
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"]
|
"Activate_galaxy_description", "Activate_related_events", "Activate_internationalization_fonts", "Custom_fonts_path"]
|
||||||
|
|
||||||
|
|
||||||
def init_event(self):
|
def init_event(self):
|
||||||
self.mispevent.info = 'This is a test'
|
self.mispevent.info = 'This is a test'
|
||||||
self.mispevent.distribution = 1
|
self.mispevent.distribution = 1
|
||||||
|
@ -409,7 +411,6 @@ class TestMISPEvent(unittest.TestCase):
|
||||||
config[self.moduleconfig[4]] = True
|
config[self.moduleconfig[4]] = True
|
||||||
config[self.moduleconfig[5]] = True
|
config[self.moduleconfig[5]] = True
|
||||||
|
|
||||||
|
|
||||||
file_nb = str(len(os.listdir(self.test_batch_folder)))
|
file_nb = str(len(os.listdir(self.test_batch_folder)))
|
||||||
i = 0
|
i = 0
|
||||||
t = time.time()
|
t = time.time()
|
||||||
|
|
Loading…
Reference in New Issue