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

Jens Vagelpohl jens at dataflake.org
Sun Aug 15 14:57:02 EDT 2004


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

Modified Files:
	testFileCacheManager.py 
Log Message:
- add simplistic test for TAL naming expression-driven naming policy


=== Products/FileCacheManager/tests/testFileCacheManager.py 1.5 => 1.6 ===
--- Products/FileCacheManager/tests/testFileCacheManager.py:1.5	Fri Aug 13 08:53:50 2004
+++ Products/FileCacheManager/tests/testFileCacheManager.py	Sun Aug 15 14:57:02 2004
@@ -39,6 +39,9 @@
 
     def getId(self):
         return self.id
+
+    def absolute_url(self, relative=0):
+        return self.fakepath
     
 
 class FileCacheTestBase(unittest.TestCase):
@@ -69,10 +72,18 @@
         self.assertEqual(self.FC.getDir(), '/tmp')
 
     def testZCache_set(self):
+        # First, test against the standard non-TAL-Expression munger
         for ob in self.all_files:
             self.FC.ZCache_set(ob)
             # don't know how to verify that it worked
             # without testing the implementation.
+            fpath = self.FC._fileName(ob)
+            self.failUnless(os.path.exists(fpath))
+
+        # Now, add a TAL naming expression
+        self.FC.setNamingExpression("python: object_url.replace('/', '_')")
+        for ob in self.all_files:
+            self.FC.ZCache_set(ob)
             fpath = self.FC._fileName(ob)
             self.failUnless(os.path.exists(fpath))
             



More information about the Zope-CVS mailing list