diff --git a/glymur/jp2box.py b/glymur/jp2box.py index bd60c30..c946e6b 100644 --- a/glymur/jp2box.py +++ b/glymur/jp2box.py @@ -1034,8 +1034,8 @@ class ContiguousCodestreamBox(Jp2kBox): return self._codestream def __repr__(self): - msg = "glymur.jp2box.ContiguousCodeStreamBox(main_header={0})" - return msg.format(repr(self.main_header)) + msg = "glymur.jp2box.ContiguousCodeStreamBox(codestream={0})" + return msg.format(repr(self.codestream)) def __str__(self): msg = Jp2kBox.__str__(self) diff --git a/glymur/test/fixtures.py b/glymur/test/fixtures.py index 12b0c71..dc27b0e 100644 --- a/glymur/test/fixtures.py +++ b/glymur/test/fixtures.py @@ -2,6 +2,7 @@ Test fixtures common to more than one test point. """ import os +import platform import re import sys import textwrap @@ -33,6 +34,14 @@ elif re.match('1.[0-6]', six.__version__) is not None: WARNING_INFRASTRUCTURE_ISSUE = True msg = "Cannot run test with version {0} of python-six" WARNING_INFRASTRUCTURE_MSG = msg.format(six.__version__) +elif ((re.match('1.8', six.__version__) is not None) and + (sys.platform.startswith('linux')) and + (platform.linux_distribution() == ('LinuxMint', '17', 'qiana'))): + WARNING_INFRASTRUCTURE_ISSUE = True + linux_distribution = platform.linux_distribution() + msg = "Cannot run test with version {0} of python-six on {1}" + WARNING_INFRASTRUCTURE_MSG = msg.format(six.__version__, + platform.linux_distribution) # Cannot reopen a named temporary file in windows. WINDOWS_TMP_FILE_MSG = "cannot use NamedTemporaryFile like this in windows" diff --git a/glymur/test/test_glymur_warnings.py b/glymur/test/test_glymur_warnings.py index ff18c6e..1d3dc2e 100644 --- a/glymur/test/test_glymur_warnings.py +++ b/glymur/test/test_glymur_warnings.py @@ -20,6 +20,13 @@ from .fixtures import WARNING_INFRASTRUCTURE_ISSUE, WARNING_INFRASTRUCTURE_MSG class TestWarnings(unittest.TestCase): """Test suite for warnings issued by glymur.""" + def test_invalid_compatibility_list_entry(self): + """should not error out with invalid compatibility list entry""" + filename = opj_data_file('input/nonregression/issue397.jp2') + with self.assertWarns(UserWarning): + Jp2k(filename) + self.assertTrue(True) + def test_exceeded_box_length(self): """ should warn if reading past end of a box diff --git a/glymur/test/test_jp2box.py b/glymur/test/test_jp2box.py index 9ccd75b..e43eae6 100644 --- a/glymur/test/test_jp2box.py +++ b/glymur/test/test_jp2box.py @@ -1016,7 +1016,7 @@ class TestJp2Boxes(unittest.TestCase): """Raw instantiation should not produce a main_header.""" box = ContiguousCodestreamBox() self.assertEqual(box.box_id, 'jp2c') - self.assertIsNone(box.main_header) + self.assertIsNone(box.codestream) def test_codestream_main_header_offset(self): """main_header_offset is an attribute of the CCS box""" @@ -1318,7 +1318,7 @@ class TestRepr(MetadataBase): # Difficult to eval(repr()) this, so just match the general pattern. regexp = "glymur.jp2box.ContiguousCodeStreamBox" - regexp += "[(]main_header=