[CMF-checkins] CVS: CMF/CMFCore/tests - test_DirectoryView.py:1.1.2.3
Chris Withers
chrisw@nipltd.com
Fri, 25 Jan 2002 09:31:42 -0500
Update of /cvs-repository/CMF/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv27369
Modified Files:
Tag: ChrisW-DirectoryView_fix-branch
test_DirectoryView.py
Log Message:
changes suggested by Tres :-)
=== CMF/CMFCore/tests/test_DirectoryView.py 1.1.2.2 => 1.1.2.3 ===
from unittest import TestCase, TestSuite, makeSuite, main
-from Products.CMFCore.DirectoryView import registerDirectory,addDirectoryViews,DirectoryViewSurrogate
+from Products.CMFCore.DirectoryView import \
+ registerDirectory,addDirectoryViews,DirectoryViewSurrogate
from Globals import package_home, DevelopmentMode
from Acquisition import Implicit
from os import remove, mkdir, rmdir
@@ -12,12 +13,6 @@
class DirectoryViewTests1( TestCase ):
- def setUp( self ):
- get_transaction().begin()
-
- def tearDown( self ):
- get_transaction().abort()
-
def test_registerDirectory( self ):
""" Test registerDirectory """
registerDirectory('fake_skins', globals())
@@ -34,14 +29,10 @@
class DirectoryViewTests2( TestCase ):
def setUp( self ):
- get_transaction().begin()
registerDirectory('fake_skins', globals())
ob = self.ob = Dummy()
addDirectoryViews(ob, 'fake_skins', globals())
- def tearDown( self ):
- get_transaction().abort()
-
def test_addDirectoryViews( self ):
""" Test addDirectoryViews """
pass
@@ -52,11 +43,11 @@
appears as a DirectoryViewSurrogate due
to Acquisition hackery.
"""
- assert isinstance(self.ob.fake_skin,DirectoryViewSurrogate)
+ self.failUnless(isinstance(self.ob.fake_skin,DirectoryViewSurrogate))
def test_DirectoryViewMethod( self ):
""" Check if DirectoryView method works """
- assert self.ob.fake_skin.test1()=='test1'
+ self.assertEqual(self.ob.fake_skin.test1(),'test1')
test1path = join(skin_path_name,'test1.py')
test2path = join(skin_path_name,'test2.py')
@@ -67,7 +58,6 @@
class DebugModeTests( TestCase ):
def setUp( self ):
- get_transaction().begin()
# initialise skins
registerDirectory('fake_skins', globals())
@@ -105,26 +95,24 @@
# it might be gone already
pass
- get_transaction().abort()
-
def test_AddNewMethod( self ):
"""
See if a method added to the skin folder can be found
"""
- assert self.ob.fake_skin.test2()=='test2'
+ self.assertEqual(self.ob.fake_skin.test2(),'test2')
def test_EditMethod( self ):
"""
See if an edited method exhibits its new behaviour
"""
- assert self.ob.fake_skin.test1()=='new test1'
+ self.assertEqual(self.ob.fake_skin.test1(),'new test1')
def test_NewFolder( self ):
"""
See if a new folder shows up
"""
# This fails for some bizarre reason :-( - CW
- # assert isinstance(self.ob.fake_skin.test3,DirectoryViewSurrogate)
+ self.failUnless(isinstance(self.ob.fake_skin.test3,DirectoryViewSurrogate))
self.ob.fake_skin.test3.objectIds()
def test_DeleteMethod( self ):