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.
self.fetch()
?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 call self.listener = reactor.listenTCP(<someport>, YourCycloneApplication())
in the setUp
method inside your test case and call self.listener.stopListening()
in the tearDown
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.