Changeset 1992
- Timestamp:
- 06/28/08 13:48:11
- Files:
-
- trunk/cherrypy/test/py25.py (modified) (2 diffs)
- trunk/cherrypy/test/test_core.py (modified) (1 diff)
- trunk/cherrypy/test/test_tools.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/test/py25.py
r1991 r1992 1 1 """Test module for Python 2.5-specific syntax, like the @-decorator syntax.""" 2 2 3 from cherrypy import expose 3 from cherrypy import expose, tools 4 4 5 5 … … 27 27 28 28 29 class ToolExamples(object): 30 31 @expose 32 @tools.response_headers(headers=[('Content-Type', 'application/data')]) 33 def blah(self): 34 yield "blah" 35 # This is here to demonstrate that _cp_config = {...} overwrites 36 # the _cp_config attribute added by the Tool decorator. You have 37 # to write _cp_config[k] = v or _cp_config.update(...) instead. 38 blah._cp_config['response.stream'] = True 39 40 trunk/cherrypy/test/test_core.py
r1990 r1992 950 950 951 951 def testCookies(self): 952 import sys953 952 if sys.version_info >= (2, 5): 954 953 self.getPage("/cookies/single?name=First", trunk/cherrypy/test/test_tools.py
r1978 r1992 1 1 """Test the various means of instantiating and invoking tools.""" 2 2 3 import gzip, StringIO 3 import gzip 4 import StringIO 5 import sys 4 6 import time 5 7 timeout = 0.2 … … 229 231 app = cherrypy.tree.mount(root, config=conf) 230 232 app.request_class.namespaces['myauth'] = myauthtools 233 234 if sys.version_info >= (2, 5): 235 from cherrypy.test import py25 236 root.tooldecs = py25.ToolExamples() 231 237 232 238 … … 363 369 self.getPage("/tarfile") 364 370 self.assertBody("I am a tarfile") 371 372 def testToolWithConfig(self): 373 if not sys.version_info >= (2, 5): 374 print "skipped (Python 2.5+ only)", 375 return 376 377 self.getPage('/tooldecs/blah') 378 self.assertHeader('Content-Type', 'application/data') 365 379 366 380

