On Sat, Sep 27, 2008 at 10:15 PM, Matt Wilson <[EMAIL PROTECTED]> wrote:
>
> Hi -- right now, when I test my controller methods, I run my server
> and then use twill to automate a browser walking through my site.
>
> For some controller methods, I'd like to be able to test them as
> regular python functions, rather than as web service calls.
>
> Is it possible to use doctests to test controller methods?
>
> Can anyone post a trivial example?
>
> Thanks
>
> Matt

If you combine Grig Gheorghiu's doctest-with-twill recipe [1] with the
fact that TG 1.1's testutil.mount returns a wsgi app [2], you should
be able to get something working.  If you're still running 1.0, you
can just use cherrypy._cpwsgi.wsgiApp instead of testutil.mount.

[1] 
http://agiletesting.blogspot.com/2006/04/in-process-web-app-testing-with-twill.html
[2]
http://docs.turbogears.org/1.1/Testing#tgtest-alternatives

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to