Esempio n. 1
0
 def test_raster_cover(self):  # {{{
     def rt(root):
         return read_raster_cover(root, read_prefixes(root), read_refines(root))
     root = self.get_opf('<meta name="cover" content="cover"/>', '<item id="cover" media-type="image/jpeg" href="x.jpg"/>')
     self.ae('x.jpg', rt(root))
     root = self.get_opf('<meta name="cover" content="cover"/>',
                         '<item id="cover" media-type="image/jpeg" href="x.jpg"/><item media-type="image/jpeg" href="y.jpg" properties="cover-image"/>')
     self.ae('y.jpg', rt(root))
     ensure_is_only_raster_cover(root, read_prefixes(root), read_refines(root), 'x.jpg')
     self.ae('x.jpg', rt(root))
     self.ae(['x.jpg'], root.xpath('//*[@properties="cover-image"]/@href'))
     self.assertFalse(root.xpath('//*[@name]'))
 def test_raster_cover(self):  # {{{
     def rt(root):
         return read_raster_cover(root, read_prefixes(root), read_refines(root))
     root = self.get_opf('<meta name="cover" content="cover"/>', '<item id="cover" media-type="image/jpeg" href="x.jpg"/>')
     self.ae('x.jpg', rt(root))
     root = self.get_opf('<meta name="cover" content="cover"/>',
                         '<item id="cover" media-type="image/jpeg" href="x.jpg"/><item media-type="image/jpeg" href="y.jpg" properties="cover-image"/>')
     self.ae('y.jpg', rt(root))
     ensure_is_only_raster_cover(root, read_prefixes(root), read_refines(root), 'x.jpg')
     self.ae('x.jpg', rt(root))
     self.ae(['x.jpg'], root.xpath('//*[@properties="cover-image"]/@href'))
     self.assertFalse(root.xpath('//*[@name]'))