def test_image_to_ppm(self): self.pt.registerTransform(image_to_ppm()) imgFile = open(input_file_path("logo.png"), "rb") data = imgFile.read() self.failUnlessEqual(self.mimetypes_registry.classify(data), "image/png") data = self.pt.convertTo(target_mimetype="image/x-portable-pixmap", orig=data) self.failUnlessEqual(data.getMetadata()["mimetype"], "image/x-portable-pixmap")
def test_image_to_ppm(self): self.pt.registerTransform(image_to_ppm()) imgFile = open(input_file_path('logo.png'), 'rb') data = imgFile.read() self.assertEqual(self.mimetypes_registry.classify(data),'image/png') data = self.pt.convertTo(target_mimetype='image/x-portable-pixmap',orig=data) self.assertEqual(data.getMetadata()['mimetype'], 'image/x-portable-pixmap')
def test_image_to_ppm(self): self.assert_image_transformed(image_to_ppm(), 'logo.png', 'image/png', 'image/x-portable-pixmap')