Removed OPENJP2_IS_V2_OFFICIAL token. #224

This can be done by a regular expression against the library version.
It had not been done because much of the original development was
against the svn 2.0+ version of openjpeg before the library version got
bumped to 2.1
This commit is contained in:
John Evans 2014-04-24 12:01:53 -04:00
commit e4578db535
7 changed files with 28 additions and 41 deletions

View file

@ -6,6 +6,7 @@ Tests for libopenjp2 wrapping functions.
# pylint: disable=R0904,W0142
import os
import re
import sys
import tempfile
import unittest
@ -15,17 +16,13 @@ import numpy as np
import glymur
from glymur.lib import openjp2
OPENJP2_IS_V2_OFFICIAL = False
if openjp2.OPENJP2 is not None:
if not hasattr(openjp2.OPENJP2,
'opj_stream_create_default_file_stream_v3'):
OPENJP2_IS_V2_OFFICIAL = True
@unittest.skipIf(os.name == "nt", "Temporary file issue on window.")
@unittest.skipIf(openjp2.OPENJP2 is None,
"Missing openjp2 library.")
@unittest.skipIf(OPENJP2_IS_V2_OFFICIAL, "API followed here specific to V2.0+")
@unittest.skipIf(re.match(r'''(1|2.0)''',
glymur.version.openjpeg_version) is not None,
"Not to be run until 2.1.0")
class TestOpenJP2(unittest.TestCase):
"""Test openjp2 library functionality.