[twill] Running twill on cherrypy3

Kumar McMillan kumar.mcmillan at gmail.com
Tue Jan 15 13:18:20 PST 2008


On Jan 13, 2008 11:17 PM, Robert MannI <robmnl at gmail.com> wrote:
> Hi!   Titus recommended me this mailing list, mentioning K. McMillan's
> name as a helpful resource.
>
> I am trying to run twill on cherrypy3.
>
>
> The examples in http://ivory.idyll.org/articles/twill-and-wsgi_intercept.html
>   seem to be for 2x versions of cherrypy, and as I have learned by
> now, cherrypy 3 seems to introduce many changes in the codebase.
>
>
>
> Specifically, the following marked line is giving me problems,
> cherryPy3 doesn't seem to be accepting initOnly and server class
> parameters anymore:
>
> <code>
> > import cherrypy
> > from cherrypy.tutorial.tut01_helloworld import HelloWorld
> >
> > # set up the root object
> > cherrypy.root = HelloWorld()
> >
> > # initialize
> > cherrypy.server.start(initOnly=True, serverClass=None)
> > <----------     right here

what happens if you change it to simply:

cherrypy.server.start()

?

If that doesn't work, you may need to consult the cherrypy docs for
the correct way to start a server for testing.

> >
> > # get WSGI app.
> > from cherrypy._cpwsgi import wsgiApp
>
> </code>
>
>
> How could I get this to work under cherrypy3?
>
>
>
> Also, why doesn't the test class in that tutorial inherit anything?
> Shouldn't it inherit from unittest.TestCase?

the tutorial was written for use with nose, a test-runner that does
not require test classes to descend from unittest.TestCase.  The
caveat is that you would need to run your tests with nose:
http://somethingaboutorange.com/mrl/projects/nose/

>
> <code>
> > class TestHelloWorld:
> >   def setUp(self):
> >      pass
> >
> >   def tearDown(self):
> >      pass
>
> </code>
>
>
>
>
>
> Thanks for help.
> Rob
>
> _______________________________________________
> twill mailing list
> twill at lists.idyll.org
> http://lists.idyll.org/listinfo/twill
>



More information about the twill mailing list