Esempio n. 1
0
 def test_getelement_raises_on_bad_itemuri(self):
     """BaseFileSystem.getelement(itemURI) raises on bad itemURI"""
     # setup -----------------------
     bad_itemURI = "/spam/eggs/egg1.xml"
     fs = FileSystem(zip_pkg_path)
     # verify ----------------------
     with self.assertRaises(LookupError):
         fs.getelement(bad_itemURI)
Esempio n. 2
0
 def test_getelement_raises_on_binary(self):
     """Calling getelement() for binary item raises exception"""
     # call getelement for thumbnail
     fs = FileSystem(zip_pkg_path)
     with self.assertRaises(NotXMLError):
         fs.getelement("/docProps/thumbnail.jpeg")