Added XMP test. closes #23

This commit is contained in:
John Evans 2013-06-04 16:05:20 -04:00
commit b2d432770a

View file

@ -646,6 +646,16 @@ class TestJp2k(unittest.TestCase):
with self.assertWarns(UserWarning) as cw:
imp.reload(glymur)
def test_xmp_attribute(self):
# Verify that we can read the XMP packet in our shipping example file.
j = Jp2k(self.jp2file)
xmp = j.box[4].data
ns0 = '{http://www.w3.org/1999/02/22-rdf-syntax-ns#}'
ns1 = '{http://ns.adobe.com/xap/1.0/}'
name = '{0}RDF/{0}Description'.format(ns0)
elt = xmp.find(name)
attr_value = elt.attrib['{0}CreatorTool'.format(ns1)]
self.assertEqual(attr_value, 'glymur')
if __name__ == "__main__":
unittest.main()