I have been googling and asking on IRC to no avail. Cyclone is supposed to be a Tornado-like protocol for Twisted. But, there are no tests in the Cyclone repository and no-one has written up how to convert tornado.testing.AsyncHTTPTestCase
tests to exercise code written against Cyclone.
- How do I start a server to test the web interface?
- Where is the
self.fetch()
? - Where is the documentation in Cyclone to describe how to convert an existing Tornado app?
Unfortunately, there's nothing like
tornado.testing.AsyncHTTPTestCase
in cyclone at the moment. Your best bet would be to use Twisted Trial to write unit tests. One (slightly kludgy) approach would be explicitly callself.listener = reactor.listenTCP(<someport>, YourCycloneApplication())
in thesetUp
method inside your test case and callself.listener.stopListening()
in thetearDown
method.Then, inside your test methods, you could use
cyclone.httpclient.fetch
to fetch the pages. This is far from ideal. But as of now, this is the only way to go.