From 8a7c6faf4a626d0573f1c8b9fd2dfd91d99f1ab5 Mon Sep 17 00:00:00 2001 From: Brian Warner Date: Wed, 29 Nov 2017 16:54:03 -0600 Subject: [PATCH] more test simplification with assertNoResult --- src/wormhole/test/test_server.py | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/src/wormhole/test/test_server.py b/src/wormhole/test/test_server.py index 5482594..6cc202f 100644 --- a/src/wormhole/test/test_server.py +++ b/src/wormhole/test/test_server.py @@ -619,11 +619,9 @@ class WSClientSync(unittest.TestCase): kwargs["type"] = mtype c.onMessage(json.dumps(kwargs).encode("utf-8"), False) # no queued messages - sunc = [] d = c.sync() - d.addBoth(sunc.append) self.assertEqual(sent, [("ping", {"ping": 0})]) - self.assertEqual(sunc, []) + self.assertNoResult(d) add("pong", pong=0) yield d self.assertEqual(c.events, []) @@ -631,9 +629,7 @@ class WSClientSync(unittest.TestCase): # one,two,ping,pong add("one") add("two", two=2) - sunc = [] d = c.sync() - d.addBoth(sunc.append) add("pong", pong=1) yield d m = yield c.next_non_ack() @@ -644,9 +640,7 @@ class WSClientSync(unittest.TestCase): # one,ping,two,pong add("one") - sunc = [] d = c.sync() - d.addBoth(sunc.append) add("two", two=2) add("pong", pong=2) yield d @@ -657,9 +651,7 @@ class WSClientSync(unittest.TestCase): self.assertEqual(c.events, []) # ping,one,two,pong - sunc = [] d = c.sync() - d.addBoth(sunc.append) add("one") add("two", two=2) add("pong", pong=3)