Back to index

plone3  3.1.7
Public Member Functions | Public Attributes | Private Member Functions
Marshall.tests.test_marshall.BlobMarshallTest Class Reference
Inheritance diagram for Marshall.tests.test_marshall.BlobMarshallTest:
Inheritance graph
[legend]
Collaboration diagram for Marshall.tests.test_marshall.BlobMarshallTest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def afterSetUp
def createBlob
def test_blob_image
def test_blob_file_text
def test_blob_file_binary
def test_blob_file_html
def test_blob_text_text
def test_blob_text_binary
def test_blob_text_html

Public Attributes

 qi
 tool
 marshaller

Private Member Functions

def _test_blob_roundtrip

Detailed Description

Definition at line 418 of file test_marshall.py.


Member Function Documentation

def Marshall.tests.test_marshall.BlobMarshallTest._test_blob_roundtrip (   self,
  fname,
  data,
  mimetype,
  filename 
) [private]

Definition at line 434 of file test_marshall.py.

00434 
00435     def _test_blob_roundtrip(self, fname, data, mimetype, filename):
00436         blob = self.createBlob(self.portal, 'blob')
00437 
00438         field = blob.Schema()[fname]
00439         field.set(blob, data, mimetype=mimetype, filename=filename)
00440 
00441         # Marshall to XML
00442         ctype, length, got = self.marshaller.marshall(blob)
00443 
00444         # Populate from XML
00445         self.marshaller.demarshall(blob, got)
00446 
00447         # Marshall from XML again and compare to see if it's
00448         # unchanged.
00449         ctype, length, got2 = self.marshaller.marshall(blob)
00450         self.assertEqualsDiff(got, got2)

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 420 of file test_marshall.py.

00420 
00421     def afterSetUp(self):
00422         super(BlobMarshallTest, self).afterSetUp()
00423         self.loginPortalOwner()
00424         self.qi = self.portal.portal_quickinstaller
00425         self.qi.installProduct('Marshall')
00426         self.tool = getToolByName(self.portal, tool_id)
00427         self.marshaller = getComponent('atxml')

Here is the call graph for this function:

def Marshall.tests.test_marshall.BlobMarshallTest.createBlob (   self,
  ctx,
  id,
  kw 
)

Definition at line 428 of file test_marshall.py.

00428 
00429     def createBlob(self, ctx, id, **kw):
00430         blob.addBlob(ctx, id, **kw)
00431         ob = ctx._getOb(id)
00432         ob.indexObject()
00433         return ob

Here is the caller graph for this function:

Definition at line 459 of file test_marshall.py.

00459 
00460     def test_blob_file_binary(self):
00461         data = get_data('file.pdf')
00462         self._test_blob_roundtrip('afile', data, 'application/pdf', 'file.pdf')

Here is the call graph for this function:

Definition at line 463 of file test_marshall.py.

00463 
00464     def test_blob_file_html(self):
00465         data = get_data('file.html')
00466         self._test_blob_roundtrip('afile', data, 'text/html', 'file.html')

Here is the call graph for this function:

Definition at line 455 of file test_marshall.py.

00455 
00456     def test_blob_file_text(self):
00457         data = get_data('file.txt')
00458         self._test_blob_roundtrip('afile', data, 'text/plain', 'file.txt')

Here is the call graph for this function:

Definition at line 451 of file test_marshall.py.

00451 
00452     def test_blob_image(self):
00453         data = get_data('image.gif')
00454         self._test_blob_roundtrip('aimage', data, 'image/gif', 'image.gif')

Here is the call graph for this function:

Definition at line 471 of file test_marshall.py.

00471 
00472     def test_blob_text_binary(self):
00473         data = get_data('file.pdf')
00474         self._test_blob_roundtrip('atext', data, 'application/pdf', 'file.pdf')

Here is the call graph for this function:

Definition at line 475 of file test_marshall.py.

00475 
00476     def test_blob_text_html(self):
00477         data = get_data('file.html')
00478         self._test_blob_roundtrip('atext', data, 'text/html', 'file.html')

Here is the call graph for this function:

Definition at line 467 of file test_marshall.py.

00467 
00468     def test_blob_text_text(self):
00469         data = get_data('file.txt')
00470         self._test_blob_roundtrip('atext', data, 'text/plain', 'file.txt')

Here is the call graph for this function:


Member Data Documentation

Definition at line 426 of file test_marshall.py.

Definition at line 423 of file test_marshall.py.

Definition at line 425 of file test_marshall.py.


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