filtered out tests that should not run on linux where no openjpeg

This commit is contained in:
John Evans 2014-11-18 11:32:55 -05:00
commit 982e70be79
3 changed files with 11 additions and 4 deletions

View file

@ -34,6 +34,7 @@ from glymur.jp2box import FileTypeBox, ImageHeaderBox, JP2HeaderBox
from glymur.jp2box import JPEG2000SignatureBox from glymur.jp2box import JPEG2000SignatureBox
from glymur.core import COLOR, OPACITY from glymur.core import COLOR, OPACITY
from glymur.core import RED, GREEN, BLUE, GREY, WHOLE_IMAGE from glymur.core import RED, GREEN, BLUE, GREY, WHOLE_IMAGE
from glymur.version import openjpeg_version
from .fixtures import ( from .fixtures import (
WARNING_INFRASTRUCTURE_ISSUE, WARNING_INFRASTRUCTURE_MSG, WARNING_INFRASTRUCTURE_ISSUE, WARNING_INFRASTRUCTURE_MSG,
@ -54,6 +55,8 @@ def load_tests(loader, tests, ignore):
tests.addTests(doctest.DocTestSuite('glymur.jp2box')) tests.addTests(doctest.DocTestSuite('glymur.jp2box'))
return tests return tests
@unittest.skipIf(re.match('0|1.[0-2]', openjpeg_version) is not None,
"Not supported with OpenJPEG {0}".format(openjpeg_version))
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.") @unittest.skipIf(os.name == "nt", "Temporary file issue on window.")
class TestDataEntryURL(unittest.TestCase): class TestDataEntryURL(unittest.TestCase):
"""Test suite for DataEntryURL boxes.""" """Test suite for DataEntryURL boxes."""
@ -119,7 +122,7 @@ class TestDataEntryURL(unittest.TestCase):
self.assertEqual(url + chr(0), read_url) self.assertEqual(url + chr(0), read_url)
@unittest.skipIf(re.match(r'''(1|2.0.0)''', @unittest.skipIf(re.match(r'''0|1|2.0.0''',
glymur.version.openjpeg_version) is not None, glymur.version.openjpeg_version) is not None,
"Not supported until 2.1") "Not supported until 2.1")
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.") @unittest.skipIf(os.name == "nt", "Temporary file issue on window.")

View file

@ -494,7 +494,7 @@ class TestJp2k(unittest.TestCase):
actdata = j2.read() actdata = j2.read()
self.assertTrue(fixtures.mse(actdata[0], expdata[0]) < 0.38) self.assertTrue(fixtures.mse(actdata[0], expdata[0]) < 0.38)
@unittest.skipIf(re.match('1.[0-4]', openjpeg_version) is not None, @unittest.skipIf(re.match('0|1.[0-4]', openjpeg_version) is not None,
"Not supported with OpenJPEG {0}".format(openjpeg_version)) "Not supported with OpenJPEG {0}".format(openjpeg_version))
@unittest.skipIf(re.match('1.5.(1|2)', openjpeg_version) is not None, @unittest.skipIf(re.match('1.5.(1|2)', openjpeg_version) is not None,
"Mysteriously fails in 1.5.1 and 1.5.2") "Mysteriously fails in 1.5.1 and 1.5.2")
@ -826,7 +826,7 @@ class TestJp2k(unittest.TestCase):
self.assertEqual(data.shape, (1024, 1024, 3)) self.assertEqual(data.shape, (1024, 1024, 3))
@unittest.skipIf(re.match('1.[0-4]', openjpeg_version) is not None, @unittest.skipIf(re.match('0|1.[0-4]', openjpeg_version) is not None,
"Not supported with OpenJPEG {0}".format(openjpeg_version)) "Not supported with OpenJPEG {0}".format(openjpeg_version))
@unittest.skipIf(os.name == "nt", "NamedTemporaryFile issue on windows") @unittest.skipIf(os.name == "nt", "NamedTemporaryFile issue on windows")
class TestJp2k_write(unittest.TestCase): class TestJp2k_write(unittest.TestCase):
@ -1100,7 +1100,7 @@ class TestJp2k_2_0(unittest.TestCase):
self.assertEqual(jasoc.box[3].box[1].box_id, 'xml ') self.assertEqual(jasoc.box[3].box[1].box_id, 'xml ')
@unittest.skipIf(re.match(r'''(1|2.0.0)''', @unittest.skipIf(re.match(r'''0|1|2.0.0''',
glymur.version.openjpeg_version) is not None, glymur.version.openjpeg_version) is not None,
"Not to be run until unless 2.0.1 or higher is present") "Not to be run until unless 2.0.1 or higher is present")
class TestJp2k_2_1(unittest.TestCase): class TestJp2k_2_1(unittest.TestCase):

View file

@ -31,6 +31,8 @@ import lxml.etree as ET
import glymur import glymur
from glymur import Jp2k, command_line from glymur import Jp2k, command_line
from glymur.version import openjpeg_version
from . import fixtures from . import fixtures
from .fixtures import OPJ_DATA_ROOT, opj_data_file from .fixtures import OPJ_DATA_ROOT, opj_data_file
from .fixtures import WARNING_INFRASTRUCTURE_ISSUE, WARNING_INFRASTRUCTURE_MSG from .fixtures import WARNING_INFRASTRUCTURE_ISSUE, WARNING_INFRASTRUCTURE_MSG
@ -106,6 +108,8 @@ class TestPrinting(unittest.TestCase):
with self.assertRaises(TypeError): with self.assertRaises(TypeError):
glymur.set_printoptions(hi='low') glymur.set_printoptions(hi='low')
@unittest.skipIf(re.match('0|1.[0-4]', openjpeg_version) is not None,
"Not supported with OpenJPEG {0}".format(openjpeg_version))
def test_asoc_label_box(self): def test_asoc_label_box(self):
"""verify printing of asoc, label boxes""" """verify printing of asoc, label boxes"""
# Construct a fake file with an asoc and a label box, as # Construct a fake file with an asoc and a label box, as