Back to index

plone3  3.1.7
Public Member Functions | Public Attributes
PortalTransforms.tests.test_transforms.PILTransformsTest Class Reference
Inheritance diagram for PortalTransforms.tests.test_transforms.PILTransformsTest:
Inheritance graph
[legend]
Collaboration diagram for PortalTransforms.tests.test_transforms.PILTransformsTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def test_image_to_bmp
def test_image_to_gif
def test_image_to_jpeg
def test_image_to_png
def test_image_to_pcx
def test_image_to_ppm
def test_image_to_tiff

Public Attributes

 pt

Detailed Description

Definition at line 81 of file test_transforms.py.


Member Function Documentation

Definition at line 82 of file test_transforms.py.

00082 
00083     def afterSetUp(self):
00084         ATSiteTestCase.afterSetUp(self)
00085         self.pt = self.portal.portal_transforms

Definition at line 86 of file test_transforms.py.

00086 
00087     def test_image_to_bmp(self):
00088         self.pt.registerTransform(image_to_bmp())
00089         imgFile = open(input_file_path('logo.jpg'), 'rb')
00090         data = imgFile.read()
00091         self.failUnlessEqual(self.portal.mimetypes_registry.classify(data),'image/jpeg')
00092         data = self.pt.convertTo(target_mimetype='image/x-ms-bmp',orig=data)
00093         self.failUnlessEqual(data.getMetadata()['mimetype'], 'image/x-ms-bmp')

Here is the call graph for this function:

Definition at line 94 of file test_transforms.py.

00094 
00095     def test_image_to_gif(self):
00096         self.pt.registerTransform(image_to_gif())
00097         imgFile = open(input_file_path('logo.png'), 'rb')
00098         data = imgFile.read()
00099         self.failUnlessEqual(self.portal.mimetypes_registry.classify(data),'image/png')
00100         data = self.pt.convertTo(target_mimetype='image/gif',orig=data)
00101         self.failUnlessEqual(data.getMetadata()['mimetype'], 'image/gif')

Here is the call graph for this function:

Definition at line 102 of file test_transforms.py.

00102 
00103     def test_image_to_jpeg(self):
00104         self.pt.registerTransform(image_to_jpeg())
00105         imgFile = open(input_file_path('logo.gif'), 'rb')
00106         data = imgFile.read()
00107         self.failUnlessEqual(self.portal.mimetypes_registry.classify(data),'image/gif')
00108         data = self.pt.convertTo(target_mimetype='image/jpeg',orig=data)
00109         self.failUnlessEqual(data.getMetadata()['mimetype'], 'image/jpeg')

Here is the call graph for this function:

Definition at line 118 of file test_transforms.py.

00118 
00119     def test_image_to_pcx(self):
00120         self.pt.registerTransform(image_to_pcx())
00121         imgFile = open(input_file_path('logo.gif'), 'rb')
00122         data = imgFile.read()
00123         self.failUnlessEqual(self.portal.mimetypes_registry.classify(data),'image/gif')
00124         data = self.pt.convertTo(target_mimetype='image/pcx',orig=data)
00125         self.failUnlessEqual(data.getMetadata()['mimetype'], 'image/pcx')

Here is the call graph for this function:

Definition at line 110 of file test_transforms.py.

00110 
00111     def test_image_to_png(self):
00112         self.pt.registerTransform(image_to_png())
00113         imgFile = open(input_file_path('logo.jpg'), 'rb')
00114         data = imgFile.read()
00115         self.failUnlessEqual(self.portal.mimetypes_registry.classify(data),'image/jpeg')
00116         data = self.pt.convertTo(target_mimetype='image/png',orig=data)
00117         self.failUnlessEqual(data.getMetadata()['mimetype'], 'image/png')

Here is the call graph for this function:

Definition at line 126 of file test_transforms.py.

00126 
00127     def test_image_to_ppm(self):
00128         self.pt.registerTransform(image_to_ppm())
00129         imgFile = open(input_file_path('logo.png'), 'rb')
00130         data = imgFile.read()
00131         self.failUnlessEqual(self.portal.mimetypes_registry.classify(data),'image/png')
00132         data = self.pt.convertTo(target_mimetype='image/x-portable-pixmap',orig=data)
00133         self.failUnlessEqual(data.getMetadata()['mimetype'], 'image/x-portable-pixmap')

Here is the call graph for this function:

Definition at line 134 of file test_transforms.py.

00134 
00135     def test_image_to_tiff(self):
00136         self.pt.registerTransform(image_to_tiff())
00137         imgFile = open(input_file_path('logo.jpg'), 'rb')
00138         data = imgFile.read()
00139         self.failUnlessEqual(self.portal.mimetypes_registry.classify(data),'image/jpeg')
00140         data = self.pt.convertTo(target_mimetype='image/tiff',orig=data)
00141         self.failUnlessEqual(data.getMetadata()['mimetype'], 'image/tiff')
00142 

Here is the call graph for this function:


Member Data Documentation

Definition at line 84 of file test_transforms.py.


The documentation for this class was generated from the following file: