Commit 95ab227e authored by Guido Trotter's avatar Guido Trotter
Browse files

TestAsyncUDPSocket: remove dead code and add test



- _ThreadedClient was added on the idea of making this unittest
  concurrent, which was actually never done (we could test everything
  without it, so well)
- handle_write() was never called without filling the send queue, and
  this caused me trouble now that I learned to look at coverage
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent e9de7da4
......@@ -186,12 +186,6 @@ class TestAsyncUDPSocket(testutils.GanetiTestCase):
def testNoDoubleBind(self):
self.assertRaises(socket.error, self.client.bind, ("127.0.0.1", self.port))
def _ThreadedClient(self, payload):
self.client.enqueue_send("127.0.0.1", self.port, payload)
print "sending %s" % payload
while self.client.writable():
self.client.handle_write()
def testAsyncClientServer(self):
self.client.enqueue_send("127.0.0.1", self.port, "p1")
self.client.enqueue_send("127.0.0.1", self.port, "p2")
......@@ -200,6 +194,7 @@ class TestAsyncUDPSocket(testutils.GanetiTestCase):
self.assertEquals(self.server.received, ["p1", "p2", "terminate"])
def testSyncClientServer(self):
self.client.handle_write()
self.client.enqueue_send("127.0.0.1", self.port, "p1")
self.client.enqueue_send("127.0.0.1", self.port, "p2")
while self.client.writable():
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment