Created
October 22, 2012 12:59
-
-
Save anonymous/3931398 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from twisted.trial.unittest import TestCase | |
from twisted.internet.defer import Deferred | |
from twisted.internet import reactor | |
class TestWhyDoesThisWork(TestCase): | |
def test_return_deferred_pass(self): | |
d = Deferred() | |
d.addCallback(self.assertEqual, 10) | |
reactor.callLater(0.1, d.callback, 10) | |
return d | |
def test_return_deferred_fail(self): | |
d = Deferred() | |
d.addCallback(self.assertEqual, 10) | |
reactor.callLater(0.1, d.callback, 11) | |
return d |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment