Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
GenericSetup.tests.test_content.DAVAwareFileAdapterTests Class Reference
Inheritance diagram for GenericSetup.tests.test_content.DAVAwareFileAdapterTests:
Inheritance graph
[legend]
Collaboration diagram for GenericSetup.tests.test_content.DAVAwareFileAdapterTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def test_export_dav_file
def test_import_dav_file

Private Member Functions

def _getTargetClass
def _makeOne

Detailed Description

Definition at line 819 of file test_content.py.


Member Function Documentation

Definition at line 821 of file test_content.py.

00821 
00822     def _getTargetClass(self):
00823         from Products.GenericSetup.content import DAVAwareFileAdapter
00824         return DAVAwareFileAdapter

def GenericSetup.tests.test_content.DAVAwareFileAdapterTests._makeOne (   self,
  context,
  args,
  kw 
) [private]

Definition at line 825 of file test_content.py.

00825 
00826     def _makeOne(self, context, *args, **kw):
00827         return self._getTargetClass()(context, *args, **kw)

Definition at line 828 of file test_content.py.

00828 
00829     def test_export_dav_file(self):
00830         dav_file = _makeDAVAware('dav_file.html')
00831         adapter = self._makeOne(dav_file)
00832         context = DummyExportContext(None)
00833         adapter.export(context, 'subpath/to')
00834 
00835         self.assertEqual(len(context._wrote), 1)
00836         filename, text, content_type = context._wrote[0]
00837         self.assertEqual(filename, 'subpath/to/dav_file.html')
00838         self.assertEqual(content_type, 'text/plain')
00839         self.assertEqual(text.strip(), dav_file.manage_FTPget().strip())

Definition at line 840 of file test_content.py.

00840 
00841     def test_import_dav_file(self):
00842         from faux_objects import KNOWN_DAV
00843         VALUES = ('Title: dav_file', 'Description: abc', 'body goes here')
00844         dav_file = _makeDAVAware('dav_file.html')
00845         adapter = self._makeOne(dav_file)
00846         context = DummyImportContext(None)
00847         context._files['subpath/to/dav_file.html'] = KNOWN_DAV % VALUES
00848 
00849         adapter.import_(context, 'subpath/to')
00850         text = dav_file._was_put == KNOWN_DAV % VALUES
00851 


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