test_wormhole_new: oops, forgot yield on assertFailure

This was breaking the last test that gets run (test_xfer_util) because of the
lingering failures.
This commit is contained in:
Brian Warner 2017-03-22 10:31:08 -07:00
parent 07a49bfaca
commit 9267c204e9

View File

@ -36,7 +36,7 @@ class New(ServerBase, unittest.TestCase):
mo = re.search(r"^\d+-\w+-\w+$", code)
self.assert_(mo, code)
# w.close() fails because we closed before connecting
self.assertFailure(w.close(), errors.LonelyError)
yield self.assertFailure(w.close(), errors.LonelyError)
def test_delegated(self):
dg = Delegate()
@ -94,6 +94,12 @@ class New(ServerBase, unittest.TestCase):
w1.send(b"data")
self.assertFailure(w2.when_received(), errors.WrongPasswordError)
self.assertFailure(w1.close(), errors.WrongPasswordError)
self.assertFailure(w2.close(), errors.WrongPasswordError)
yield self.assertFailure(w2.when_received(), errors.WrongPasswordError)
# wait for w1.when_received, because if we close w1 before it has
# seen the VERSION message, we could legitimately get LonelyError
# instead of WrongPasswordError. w2 didn't send anything, so
# w1.when_received wouldn't ever callback, but it will errback when
# w1 gets the undecryptable VERSION.
yield self.assertFailure(w1.when_received(), errors.WrongPasswordError)
yield self.assertFailure(w1.close(), errors.WrongPasswordError)
yield self.assertFailure(w2.close(), errors.WrongPasswordError)