Back to index

plone3  3.1.7
Public Member Functions | Private Member Functions
CMFCore.tests.test_FSPropertiesObject.FSPOTests Class Reference
Inheritance diagram for CMFCore.tests.test_FSPropertiesObject.FSPOTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_FSPropertiesObject.FSPOTests:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def setUp
def tearDown
def test__readFile
def test__createZODBClone
def test_manage_doCustomize
def test_manage_doCustomize_alternate_root
def test_manage_doCustomize_fspath_as_dot
def test_manage_doCustomize_manual_clone

Private Member Functions

def _getTargetClass
def _makeOne
def _makeContext

Detailed Description

Definition at line 9 of file test_FSPropertiesObject.py.


Member Function Documentation

Definition at line 19 of file test_FSPropertiesObject.py.

00019 
00020     def _getTargetClass( self ):
00021         from Products.CMFCore.FSPropertiesObject import FSPropertiesObject
00022         return FSPropertiesObject

def CMFCore.tests.test_FSPropertiesObject.FSPOTests._makeContext (   self,
  po_id,
  po_filename 
) [private]

Definition at line 28 of file test_FSPropertiesObject.py.

00028 
00029     def _makeContext( self, po_id, po_filename ):
00030         from OFS.Folder import Folder
00031 
00032         self.root._setObject( 'portal_skins', Folder( 'portal_skins' ) )
00033         skins = self.root.portal_skins
00034 
00035         skins._setObject( 'custom', Folder( 'custom' ) )
00036         custom = skins.custom
00037 
00038         skins._setObject( 'fsdir', Folder( 'fsdir' ) )
00039         fsdir = skins.fsdir
00040 
00041         fsdir._setObject( 'test_props', self._makeOne( po_id, po_filename ) )
00042         fspo = fsdir.test_props
00043 
00044         return custom, fsdir, fspo

Here is the call graph for this function:

Here is the caller graph for this function:

def CMFCore.tests.test_FSPropertiesObject.FSPOTests._makeOne (   self,
  id,
  filename 
) [private]

Definition at line 23 of file test_FSPropertiesObject.py.

00023 
00024     def _makeOne( self, id, filename ):
00025         from os.path import join
00026         path = join(self.skin_path_name, filename)
00027         return self._getTargetClass()( id, path ) 

Here is the call graph for this function:

Definition at line 11 of file test_FSPropertiesObject.py.

00011 
00012     def setUp( self ):
00013         FSDVTest.setUp(self)
00014         SecurityTest.setUp( self )

Definition at line 15 of file test_FSPropertiesObject.py.

00015 
00016     def tearDown( self ):
00017         SecurityTest.tearDown( self )
00018         FSDVTest.tearDown(self)

Definition at line 63 of file test_FSPropertiesObject.py.

00063 
00064     def test__createZODBClone( self ):
00065 
00066         from OFS.Folder import Folder
00067 
00068         custom, fsdir, fspo = self._makeContext( 'test_props'
00069                                                , 'test_props.props')
00070 
00071         target = fspo._createZODBClone()
00072         self.failUnless( isinstance( target, Folder ) )
00073         for prop_id in fspo.propertyIds():
00074             self.assertEqual( target.getProperty( prop_id )
00075                             , fspo.getProperty( prop_id ) )

Here is the call graph for this function:

Definition at line 45 of file test_FSPropertiesObject.py.

00045 
00046     def test__readFile( self ):
00047         from DateTime.DateTime import DateTime
00048 
00049         custom, fsdir, fspo = self._makeContext( 'test_props'
00050                                                , 'test_props.props')
00051 
00052         self.assertEqual( fspo.getProperty( 'title' ), 'Test properties' )
00053         self.assertEqual( fspo.getProperty( 'value1' ), 'one' )
00054         self.assertEqual( fspo.getProperty( 'value2' ), 'two' )
00055         self.assertEqual( fspo.getProperty( 'an_int' ), 42 )
00056         self.assertEqual( fspo.getProperty( 'a_float' ), 3.1415926 )
00057         self.assertEqual( fspo.getProperty( 'a_boolean' ), False )
00058         self.assertEqual( fspo.getProperty( 'a_long' ), 40000000000 )
00059         self.assertEqual( fspo.getProperty( 'a_date' )
00060                         , DateTime( '01/01/2001' ) )
00061         self.assertEqual( fspo.getProperty( 'a_tokens' )
00062                         , [ 'peter', 'paul', 'mary' ] )

Here is the call graph for this function:

Definition at line 76 of file test_FSPropertiesObject.py.

00076 
00077     def test_manage_doCustomize( self ):
00078         custom, fsdir, fspo = self._makeContext( 'test_props'
00079                                                , 'test_props.props')
00080 
00081         fspo.manage_doCustomize( folder_path='custom' )
00082 
00083         self.assertEqual( len( custom.objectIds() ), 1 )
00084         self.failUnless( 'test_props' in custom.objectIds() )  

Here is the call graph for this function:

Definition at line 85 of file test_FSPropertiesObject.py.

00085 
00086     def test_manage_doCustomize_alternate_root( self ):
00087         from OFS.Folder import Folder
00088 
00089         custom, fsdir, fspo = self._makeContext( 'test_props'
00090                                                , 'test_props.props')
00091         self.root.other = Folder('other')
00092 
00093         fspo.manage_doCustomize( folder_path='other', root=self.root )
00094 
00095         self.failIf( 'test_props' in custom.objectIds() )  
00096         self.failUnless( 'test_props' in self.root.other.objectIds() )  

Here is the call graph for this function:

Definition at line 97 of file test_FSPropertiesObject.py.

00097 
00098     def test_manage_doCustomize_fspath_as_dot( self ):
00099         custom, fsdir, fspo = self._makeContext( 'test_props'
00100                                                , 'test_props.props')
00101         fspo.manage_doCustomize( folder_path='.' )
00102 
00103         self.failIf( 'test_props' in custom.objectIds() )  
00104         self.failUnless( 'test_props' in self.root.portal_skins.objectIds() )  

Here is the call graph for this function:

Definition at line 105 of file test_FSPropertiesObject.py.

00105 
00106     def test_manage_doCustomize_manual_clone( self ):
00107         from OFS.Folder import Folder
00108 
00109         custom, fsdir, fspo = self._makeContext( 'test_props'
00110                                                , 'test_props.props')
00111         clone = Folder('test_props')
00112         fspo.manage_doCustomize( folder_path='custom', obj=clone )
00113 
00114         self.failUnless( 'test_props' in custom.objectIds() )  
00115         self.failUnless( aq_base(custom._getOb('test_props')) is clone )  
00116 

Here is the call graph for this function:


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