Removed spurious static_path.
[smonitor.git] / monitor / cherrypy / test / _test_decorators.py
blob5bcbc1e6550bfda747c4ed332b5b6a2309e6b950
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):
9 @expose
10 def no_call(self):
11 return "Mr E. R. Bradshaw"
13 @expose()
14 def call_empty(self):
15 return "Mrs. B.J. Smegma"
17 @expose("call_alias")
18 def nesbitt(self):
19 return "Mr Nesbitt"
21 @expose(["alias1", "alias2"])
22 def andrews(self):
23 return "Mr Ken Andrews"
25 @expose(alias="alias3")
26 def watson(self):
27 return "Mr. and Mrs. Watson"
30 class ToolExamples(object):
32 @expose
33 @tools.response_headers(headers=[('Content-Type', 'application/data')])
34 def blah(self):
35 yield ntob("blah")
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