1 """Test module for the @-decorator syntax, which is version-specific"""
3 from cherrypy
import expose
, tools
4 from cherrypy
._cpcompat
import ntob
7 class ExposeExamples(object):
11 return "Mr E. R. Bradshaw"
15 return "Mrs. B.J. Smegma"
21 @expose(["alias1", "alias2"])
23 return "Mr Ken Andrews"
25 @expose(alias
="alias3")
27 return "Mr. and Mrs. Watson"
30 class ToolExamples(object):
33 @tools.response_headers(headers
=[('Content-Type', 'application/data')])
36 # This is here to demonstrate that _cp_config = {...} overwrites
37 # the _cp_config attribute added by the Tool decorator. You have
38 # to write _cp_config[k] = v or _cp_config.update(...) instead.
39 blah
._cp
_config
['response.stream'] = True