def test_remove_file(self): manifest = Manifest(testdata) result = manifest.find('/') self.assertIsNotNone(result) manifest.remove('/') result = manifest.find('/') self.assertIsNone(result)
def test_query_file(self): XML = '{urn:oasis:names:tc:opendocument:xmlns:manifest:1.0}' manifest = Manifest(testdata) rootfile = manifest.find('/') self.assertEqual('application/vnd.oasis.opendocument.text', rootfile.get(XML+'media-type')) rdf = manifest.find('manifest.rdf') self.assertEqual('application/rdf+xml', rdf.get(XML+'media-type'))
def test_query_file_not_found(self): manifest = Manifest(testdata) result = manifest.find('unknown.exe') self.assertIsNone(result)