Strengthened the test by reordering the boxes. #206
This commit is contained in:
parent
faf49b11c3
commit
9ecbc81e7a
1 changed files with 5 additions and 1 deletions
|
|
@ -49,12 +49,16 @@ class TestJPXWrap(unittest.TestCase):
|
|||
"""Rewrap a jpx file."""
|
||||
with tempfile.NamedTemporaryFile(suffix='.jp2') as tfile1:
|
||||
jpx = Jp2k(self.jpxfile)
|
||||
idx = list(range(5)) + list(range(6, 9)) + list(range(9, 12)) + [12]
|
||||
idx = list(range(5)) + list(range(9, 12)) + list(range(6, 9)) + [12]
|
||||
boxes = [jpx.box[j] for j in idx]
|
||||
jpx2 = jpx.wrap(tfile1.name, boxes=boxes)
|
||||
exp_ids = [box.box_id for box in boxes]
|
||||
lengths = [box.length for box in jpx.box]
|
||||
exp_lengths = [lengths[j] for j in idx]
|
||||
act_ids = [box.box_id for box in jpx2.box]
|
||||
act_lengths = [box.length for box in jpx2.box]
|
||||
self.assertEqual(exp_ids, act_ids)
|
||||
self.assertEqual(exp_lengths, act_lengths)
|
||||
|
||||
def test_jpx_ftbl_no_codestream(self):
|
||||
"""Can have a jpx with no codestream."""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue