cherrypy.test._test_decorators 源代码
"""Test module for the @-decorator syntax, which is version-specific"""
import cherrypy
from cherrypy import expose, tools
[文档]class ExposeExamples(object):
[文档] @expose
def no_call(self):
return 'Mr E. R. Bradshaw'
[文档] @expose()
def call_empty(self):
return 'Mrs. B.J. Smegma'
[文档] @expose('call_alias')
def nesbitt(self):
return 'Mr Nesbitt'
[文档] @expose(['alias1', 'alias2'])
def andrews(self):
return 'Mr Ken Andrews'
[文档] @expose(alias='alias3')
def watson(self):
return 'Mr. and Mrs. Watson'