Back to index

plone3  3.1.7
Classes | Public Member Functions | Public Attributes
CMFCore.tests.test_DirectoryView.DebugModeTests Class Reference
Inheritance diagram for CMFCore.tests.test_DirectoryView.DebugModeTests:
Inheritance graph
[legend]
Collaboration diagram for CMFCore.tests.test_DirectoryView.DebugModeTests:
Collaboration graph
[legend]

List of all members.

Classes

class  DebugModeTests

Public Member Functions

def setUp
def test_AddNewMethod
def test_EditMethod
def test_NewFolder
def test_DeleteMethod
def test_DeleteAddEditMethod
def test_DeleteFolder

Public Attributes

 test1path
 test2path
 test3path

Detailed Description

Definition at line 290 of file test_DirectoryView.py.


Class Documentation

class CMFCore::tests::test_DirectoryView::DebugModeTests::DebugModeTests

Definition at line 355 of file test_DirectoryView.py.


Member Function Documentation

Definition at line 292 of file test_DirectoryView.py.

00292 
00293     def setUp( self ):
00294         WritableFSDVTest.setUp(self)
00295         self.test1path = join(self.skin_path_name,'test1.py')
00296         self.test2path = join(self.skin_path_name,'test2.py')
00297         self.test3path = join(self.skin_path_name,'test3')
00298 
00299         # initialise skins
00300         self._registerDirectory(self)
00301 
00302         # add a method to the fake skin folder
00303         self._writeFile(self.test2path, "return 'test2'")
00304 
00305         # edit the test1 method
00306         self._writeFile(self.test1path, "return 'new test1'")
00307 
00308         # add a new folder
00309         mkdir(self.test3path)

Definition at line 310 of file test_DirectoryView.py.

00310 
00311     def test_AddNewMethod( self ):
00312         # See if a method added to the skin folder can be found
00313         self.assertEqual(self.ob.fake_skin.test2(),'test2')

Definition at line 329 of file test_DirectoryView.py.

00329 
00330     def test_DeleteAddEditMethod( self ):
00331         # Check that if we delete a method, then add it back,
00332         # then edit it, the DirectoryView notices.
00333         # This exercises yet another Win32 mtime weirdity.
00334         remove(self.test2path)
00335         self.failIf(hasattr(self.ob.fake_skin,'test2'))
00336 
00337         # add method back to the fake skin folder
00338         self._writeFile(self.test2path, "return 'test2.2'")
00339 
00340         # check
00341         self.assertEqual(self.ob.fake_skin.test2(),'test2.2')
00342 
00343         # edit method
00344         self._writeFile(self.test2path, "return 'test2.3'")
00345 
00346         # check
00347         self.assertEqual(self.ob.fake_skin.test2(),'test2.3')

Here is the call graph for this function:

Definition at line 348 of file test_DirectoryView.py.

00348 
00349     def test_DeleteFolder( self ):
00350         # Make sure a deleted folder goes away
00351         rmdir(self.test3path)
00352         self.failIf(hasattr(self.ob.fake_skin,'test3'))
00353 
00354 else:

Definition at line 324 of file test_DirectoryView.py.

00324 
00325     def test_DeleteMethod( self ):
00326         # Make sure a deleted method goes away
00327         remove(self.test2path)
00328         self.failIf(hasattr(self.ob.fake_skin,'test2'))

Definition at line 314 of file test_DirectoryView.py.

00314 
00315     def test_EditMethod( self ):
00316         # See if an edited method exhibits its new behaviour
00317         self.assertEqual(self.ob.fake_skin.test1(),'new test1')

Definition at line 318 of file test_DirectoryView.py.

00318 
00319     def test_NewFolder( self ):
00320         # See if a new folder shows up
00321         from Products.CMFCore.DirectoryView import DirectoryViewSurrogate
00322         self.failUnless(isinstance(self.ob.fake_skin.test3,DirectoryViewSurrogate))
00323         self.ob.fake_skin.test3.objectIds()


Member Data Documentation

Definition at line 294 of file test_DirectoryView.py.

Definition at line 295 of file test_DirectoryView.py.

Definition at line 296 of file test_DirectoryView.py.


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