[CMF-checkins] CVS: Products/CMFCore/tests -
test_FSFile.py:1.8.14.2 test_FSImage.py:1.10.14.1
Florent Guillaume
fg at nuxeo.com
Sun Nov 14 18:52:41 EST 2004
Update of /cvs-repository/Products/CMFCore/tests
In directory cvs.zope.org:/tmp/cvs-serv20573/CMFCore/tests
Modified Files:
Tag: CMF-1_5-branch
test_FSFile.py test_FSImage.py
Log Message:
FSFile, FSImage: Made available to caching policy manager as
standard content (Collector #299).
=== Products/CMFCore/tests/test_FSFile.py 1.8.14.1 => 1.8.14.2 ===
--- Products/CMFCore/tests/test_FSFile.py:1.8.14.1 Mon Sep 6 04:03:33 2004
+++ Products/CMFCore/tests/test_FSFile.py Sun Nov 14 18:52:10 2004
@@ -123,6 +123,18 @@
self.failUnless( data, '' )
self.assertEqual( self.RESPONSE.getStatus(), 200 )
+ def test_caching( self ):
+ self.root.caching_policy_manager = DummyCachingManager()
+ original_len = len(self.RESPONSE.headers)
+ file = self._makeOne('test_file', 'test_file.swf')
+ file = file.__of__(self.root)
+ file.index_html(self.REQUEST, self.RESPONSE)
+ headers = self.RESPONSE.headers
+ self.failUnless(len(headers) >= original_len + 3)
+ self.failUnless('foo' in headers.keys())
+ self.failUnless('bar' in headers.keys())
+ self.assertEqual(headers['test_path'], '/test_file')
+
def test_forced_content_type( self ):
path, ref = self._extractFile('test_file_two.swf')
=== Products/CMFCore/tests/test_FSImage.py 1.10 => 1.10.14.1 ===
--- Products/CMFCore/tests/test_FSImage.py:1.10 Mon Apr 26 08:14:17 2004
+++ Products/CMFCore/tests/test_FSImage.py Sun Nov 14 18:52:10 2004
@@ -111,6 +111,18 @@
self.failUnless( data, '' )
self.assertEqual( self.RESPONSE.getStatus(), 200 )
+ def test_caching( self ):
+ self.root.caching_policy_manager = DummyCachingManager()
+ original_len = len(self.RESPONSE.headers)
+ image = self._makeOne('test_image', 'test_image.gif')
+ image = image.__of__(self.root)
+ image.index_html(self.REQUEST, self.RESPONSE)
+ headers = self.RESPONSE.headers
+ self.failUnless(len(headers) >= original_len + 3)
+ self.failUnless('foo' in headers.keys())
+ self.failUnless('bar' in headers.keys())
+ self.assertEqual(headers['test_path'], '/test_image')
+
def test_suite():
return unittest.TestSuite((
More information about the CMF-checkins
mailing list