Closes #70.
This commit is contained in:
parent
39e2859a66
commit
a57de5d872
1 changed files with 12 additions and 9 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
import os
|
import os
|
||||||
import pkg_resources
|
import pkg_resources
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
import unittest
|
import unittest
|
||||||
|
|
@ -62,6 +63,8 @@ class TestCallbacks(unittest.TestCase):
|
||||||
@unittest.skipIf(glymur.lib.openjp2._OPENJPEG is None,
|
@unittest.skipIf(glymur.lib.openjp2._OPENJPEG is None,
|
||||||
"Missing openjpeg library.")
|
"Missing openjpeg library.")
|
||||||
class TestCallbacks15(unittest.TestCase):
|
class TestCallbacks15(unittest.TestCase):
|
||||||
|
"""This test suite is for OpenJPEG 1.5.1 properties.
|
||||||
|
"""
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def setUpClass(cls):
|
def setUpClass(cls):
|
||||||
|
|
@ -92,15 +95,15 @@ class TestCallbacks15(unittest.TestCase):
|
||||||
d = j.read(reduce=1, verbose=True)
|
d = j.read(reduce=1, verbose=True)
|
||||||
actual = sys.stdout.getvalue().strip()
|
actual = sys.stdout.getvalue().strip()
|
||||||
|
|
||||||
# We can't actually match this because the times will be different.
|
regex = re.compile(r"""\[INFO\]\stile\s1\sof\s1\s+
|
||||||
lines = ['[INFO] tile 1 of 1',
|
\[INFO\]\s-\stiers-1\stook\s[0-9]+\.[0-9]+\ss\s+
|
||||||
'[INFO] - tiers-1 took 0.050149 s',
|
\[INFO\]\s-\sdwt\stook\s[0-9]+\.[0-9]+\ss\s+
|
||||||
'[INFO] - dwt took 0.004188 s',
|
\[INFO\]\s-\stile\sdecoded\sin\s[0-9]+\.[0-9]+\ss""",
|
||||||
'[INFO] - tile decoded in 0.058203 s']
|
re.VERBOSE)
|
||||||
|
if sys.hexversion <= 0x03020000:
|
||||||
expected = '\n'.join(lines)
|
self.assertRegexpMatches(actual, regex)
|
||||||
self.assertTrue('[INFO]' in actual)
|
else:
|
||||||
self.assertTrue('dwt took' in actual)
|
self.assertRegex(actual, regex)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue