On Fri, May 30, 2014 at 2:13 AM, Piper Masden <[email protected]> wrote:
> I have a test that executes this function, and the deferToThread returns a
> Deferred, but that deferred never fires its callback, and so when I use
> successResultOf expecting a success result, no result is found.
"Never", or just not before you check its result? I don't think
successResultOf blocks waiting for the Deferred to fire.
Instead, you need to wait for the deferred within your test:
def testIndex(self):
d = index(..)
@d.addCallback
def check(result):
self.assertEqual(result, ..)
return d
(this could be prettier with inlineCallbacks, but this should give you the idea)
Dustin
_______________________________________________
Twisted-Python mailing list
[email protected]
http://twistedmatrix.com/cgi-bin/mailman/listinfo/twisted-python