I'd imagine you can do it the same way the tests do. Take a look at
test_controllers for examples of using the stuff in
turbogears.testutil. If you set cherrypy.root, you can call
testutil.create_request which is very much like running a request on
the web.
Kevin
On 2/14/06, Mike Orr <[EMAIL PROTECTED]> wrote:
>
> Is there a way to call a controller method from the shell as if it
> were called from the web? Trying to run it under pdb.
>
>
> >>> controllers.Root().search('formald')
> Traceback (most recent call last):
> File "<console>", line 1, in ?
> File "<string>", line 3, in search
> File
> "/usr/local/lib/python2.4/TurboGears-0.9a0dev_r768-py2.4.egg/turbogears/controllers.py",
> line 173, in expose
> cherrypy.response.headers['Content-Type'] = content_type
> File
> "/usr/local/lib/python2.4/CherryPy-2.2.0beta-py2.4.egg/cherrypy/__init__.py",
> line 40, in __getattr__
> childobject = getattr(serving, self.__attrname__)
> AttributeError: 'thread._local' object has no attribute 'response'
>
>
>
>
> --
> Mike Orr <[EMAIL PROTECTED]>
> ([EMAIL PROTECTED] address is semi-reliable)
>
--
Kevin Dangoor
Author of the Zesty News RSS newsreader
email: [EMAIL PROTECTED]
company: http://www.BlazingThings.com
blog: http://www.BlueSkyOnMars.com