[Python-checkins] CVS: python/dist/src/Lib/test test_asynchat.py,1.1,1.2
Guido van Rossum
gvanrossum@users.sourceforge.net
Fri, 06 Apr 2001 09:43:52 -0700
Update of /cvsroot/python/python/dist/src/Lib/test
In directory usw-pr-cvs1:/tmp/cvs-serv7657
Modified Files:
test_asynchat.py
Log Message:
After testing the test on Unix, several improvements:
- Use push() instead of send(), and make these calls in main().
- Sleep a second to give the server thread time to initialize itself.
Index: test_asynchat.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_asynchat.py,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -r1.1 -r1.2
*** test_asynchat.py 2001/04/06 16:32:22 1.1
--- test_asynchat.py 2001/04/06 16:43:49 1.2
***************
*** 1,5 ****
# test asynchat -- requires threading
! import asyncore, asynchat, socket, threading
HOST = "127.0.0.1"
--- 1,5 ----
# test asynchat -- requires threading
! import asyncore, asynchat, socket, threading, time
HOST = "127.0.0.1"
***************
*** 33,38 ****
self.set_terminator("\n")
self.buffer = ""
- self.send("hello ")
- self.send("world\n")
def handle_connect(self):
--- 33,36 ----
***************
*** 50,54 ****
--- 48,55 ----
s = echo_server()
s.start()
+ time.sleep(1) # Give server time to initialize
c = echo_client()
+ c.push("hello ")
+ c.push("world\n")
asyncore.loop()