Added rreg repr support. #133
This commit is contained in:
parent
0b16ca16cb
commit
9caf5c9f08
2 changed files with 28 additions and 0 deletions
|
|
@ -1506,6 +1506,18 @@ class ReaderRequirementsBox(Jp2kBox):
|
|||
self.length = length
|
||||
self.offset = offset
|
||||
|
||||
def __repr__(self):
|
||||
msg = "glymur.jp2box.ReaderRequirementsBox(fuam={fuam}, dcm={dcm}, "
|
||||
msg += "standard_flag={standard_flag}, standard_mask={standard_mask}, "
|
||||
msg += "vendor_feature={vendor_feature}, vendor_mask={vendor_mask})"
|
||||
msg = msg.format(fuam=self.fuam,
|
||||
dcm=self.dcm,
|
||||
standard_flag=self.standard_flag,
|
||||
standard_mask=self.standard_mask,
|
||||
vendor_feature=self.vendor_feature,
|
||||
vendor_mask=self.vendor_mask)
|
||||
return msg
|
||||
|
||||
def __str__(self):
|
||||
msg = Jp2kBox.__str__(self)
|
||||
|
||||
|
|
|
|||
|
|
@ -903,6 +903,22 @@ class TestRepr(unittest.TestCase):
|
|||
else:
|
||||
self.assertRegex(repr(box), regexp)
|
||||
|
||||
def test_readerrequirements_box(self):
|
||||
"""Verify rreq repr method."""
|
||||
box = glymur.jp2box.ReaderRequirementsBox(fuam=160, dcm=192,
|
||||
standard_flag=(5, 61, 43),
|
||||
standard_mask=(128, 96, 64),
|
||||
vendor_feature=[],
|
||||
vendor_mask=[])
|
||||
newbox = eval(repr(box))
|
||||
self.assertEqual(box.fuam, newbox.fuam)
|
||||
self.assertEqual(box.dcm, newbox.dcm)
|
||||
self.assertEqual(box.standard_flag, newbox.standard_flag)
|
||||
self.assertEqual(box.standard_mask, newbox.standard_mask)
|
||||
self.assertEqual(box.vendor_feature, newbox.vendor_feature)
|
||||
self.assertEqual(box.vendor_mask, newbox.vendor_mask)
|
||||
|
||||
|
||||
class TestJpxBoxes(unittest.TestCase):
|
||||
"""Tests for JPX boxes."""
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue