From b2d432770a260d5c8bc21868a861de9f7572181e Mon Sep 17 00:00:00 2001 From: John Evans Date: Tue, 4 Jun 2013 16:05:20 -0400 Subject: [PATCH] Added XMP test. closes #23 --- glymur/test/test_jp2k.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/glymur/test/test_jp2k.py b/glymur/test/test_jp2k.py index 41628c2..e05235a 100644 --- a/glymur/test/test_jp2k.py +++ b/glymur/test/test_jp2k.py @@ -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()