[Zope-CVS] CVS: Products/FileCacheManager/tests -
testFileCacheManager.py:1.8
Jens Vagelpohl
jens at dataflake.org
Mon Aug 16 05:04:13 EDT 2004
Update of /cvs-repository/Products/FileCacheManager/tests
In directory cvs.zope.org:/tmp/cvs-serv12907/tests
Modified Files:
testFileCacheManager.py
Log Message:
- add simple test getting and setting the naming expression on the FCM instance
=== Products/FileCacheManager/tests/testFileCacheManager.py 1.7 => 1.8 ===
--- Products/FileCacheManager/tests/testFileCacheManager.py:1.7 Sun Aug 15 15:37:24 2004
+++ Products/FileCacheManager/tests/testFileCacheManager.py Mon Aug 16 05:04:12 2004
@@ -163,11 +163,25 @@
self.failUnless(self.FCM.getId() == FCM_ID)
self.failUnless(self.FCM.getDir() == FCM_DIR)
self.failUnless(self.FCM.title == FCM_TITLE)
+ self.failUnless(self.FCM.getNamingExpression() == '')
def testGetSetDir(self):
self.failUnless(self.FCM.getDir() == FCM_DIR)
self.FCM.setDir('/tmp')
self.failUnless(self.FCM.getDir() == '/tmp')
+
+ def testGetSetNamingExpression(self):
+ # By default, no naming expression is used
+ self.assertEqual(self.FCM.getNamingExpression(), '')
+
+ # Set an invalid TAL naming expression, no change should occur
+ self.FCM.setNamingExpression('foo: 1+1')
+ self.assertEqual(self.FCM.getNamingExpression(), '')
+
+ # Set a valid expression
+ expr = "python: '%s.txt' % (object.getId())"
+ self.FCM.setNamingExpression(expr)
+ self.assertEquals(self.FCM.getNamingExpression(), expr)
def testGetCache(self):
c = self.FCM.ZCacheManager_getCache()
More information about the Zope-CVS
mailing list