Here is what we are currently using to test our cylinder processor, as we did with the tornado:
from twisted.trial.unittest import TestCase from twisted.internet import defer, reactor from cyclone import httpclient
That way you return the fetch method;)
And no longer need to use a trial version.
Here is a usage example:
from twisted.internet import defer class Test(TxTestCase): def get_app(self): return MyApplication() @defer.inlineCallbacks def some_test_method(self): res = yield self.fetch('/path/to/resource') self.assertEquals(200, res.code)
Hope this helps.
source share