|
|
Choosing A Webhost: |
CVS: Products/CMFCore/tests - test_FSFile.py:1.4.14.4 test_FSImage.py:1.7.1: msg#00029web.zope.cmf.cvs
Update of /cvs-repository/Products/CMFCore/tests In directory cvs.zope.org:/tmp/cvs-serv12476/CMFCore/tests Modified Files: Tag: CMF-1_4-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.4.14.3 => 1.4.14.4 === --- Products/CMFCore/tests/test_FSFile.py:1.4.14.3 Fri Apr 23 17:11:35 2004 +++ Products/CMFCore/tests/test_FSFile.py Sun Nov 14 18:15:06 2004 @@ -4,7 +4,10 @@ class DummyCachingManager: def getHTTPCachingHeaders( self, content, view_name, keywords, time=None ): - return ( ( 'foo', 'Foo' ), ( 'bar', 'Bar' ) ) + return ( + ('foo', 'Foo'), ('bar', 'Bar'), + ('test_path', '/'.join(content.getPhysicalPath())), + ) from Products.CMFCore.tests.base.testcase import RequestTest, FSDVTest @@ -118,6 +121,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_suite(): return unittest.TestSuite(( === Products/CMFCore/tests/test_FSImage.py 1.7.14.2 => 1.7.14.3 === --- Products/CMFCore/tests/test_FSImage.py:1.7.14.2 Fri Apr 23 17:11:35 2004 +++ Products/CMFCore/tests/test_FSImage.py Sun Nov 14 18:15:06 2004 @@ -4,7 +4,10 @@ class DummyCachingManager: def getHTTPCachingHeaders( self, content, view_name, keywords, time=None ): - return ( ( 'foo', 'Foo' ), ( 'bar', 'Bar' ) ) + return ( + ('foo', 'Foo'), ('bar', 'Bar'), + ('test_path', '/'.join(content.getPhysicalPath())), + ) from Products.CMFCore.tests.base.testcase import RequestTest, FSDVTest @@ -112,6 +115,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((
|
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | CVS: CMF - CHANGES.txt:1.270, Jens Vagelpohl |
|---|---|
| Next by Date: | CVS: CMF - CHANGES.txt:1.146.4.57, Florent Guillaume |
| Previous by Thread: | CVS: CMF - CHANGES.txt:1.270, Jens Vagelpohl |
| Next by Thread: | CVS: CMF - CHANGES.txt:1.146.4.57, Florent Guillaume |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
Free MagazinesCisco NewsReceive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business. subscribe Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field. subscribe The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business. subscribe Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company. subscribe Total Telecom Total Telecom is "The Economist of the communications industry". subscribe |