[Zope-CVS] CVS: Products/FileCacheManager/tests - testFileCacheManager.py:1.10

Chris McDonough chrism at plope.com
Sat Aug 28 20:53:47 EDT 2004


Update of /cvs-repository/Products/FileCacheManager/tests
In directory cvs.zope.org:/tmp/cvs-serv5688/tests

Modified Files:
	testFileCacheManager.py 
Log Message:
Add a test for tempfile path and fix tests that expected to receive a message which now cause an exception.


=== Products/FileCacheManager/tests/testFileCacheManager.py 1.9 => 1.10 ===
--- Products/FileCacheManager/tests/testFileCacheManager.py:1.9	Thu Aug 19 15:37:31 2004
+++ Products/FileCacheManager/tests/testFileCacheManager.py	Sat Aug 28 20:53:46 2004
@@ -84,14 +84,15 @@
         self.FC.setDir('/tmp')
         self.assertEqual(self.FC.getDir(), '/tmp')
 
+    def testGetSetTempfileDir(self):
+        self.assertEqual(self.FC.getTempfileDir(), '')
+        self.FC.setTempfileDir('/tmp')
+        self.assertEqual(self.FC.getTempfileDir(), '/tmp')
+
     def testGetSetNamingExpression(self):
         # By default, no naming expression is used
         self.assertEqual(self.FC._naming_expr, None)
 
-        # Set an invalid TAL naming expression, no change should occur
-        self.FC.setNamingExpression('foo: 1+1')
-        self.assertEqual(self.FC._naming_expr, None)
-
         # Set a valid expression
         expr = "python: '%s.txt' % (object.getId())"
         self.FC.setNamingExpression(expr)
@@ -202,7 +203,7 @@
         self.assertEqual(self.FCM.getNamingExpression(), '')
 
         # Set an invalid TAL naming expression, no change should occur
-        self.FCM.setNamingExpression('foo: 1+1')
+        self.assertRaises(Exception, "self.FCM.setNamingExpression('foo: 1+1')")
         self.assertEqual(self.FCM.getNamingExpression(), '')
 
         # Set a valid expression
@@ -213,8 +214,6 @@
     def testGetCache(self):
         c = self.FCM.ZCacheManager_getCache()
         self.failUnless(isinstance(c, FileCache))
-
-
 
 def test_suite():
     suite = unittest.TestSuite((



More information about the Zope-CVS mailing list