summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-08-01 21:58:18 (GMT)
committerGeorg Brandl <georg@python.org>2010-08-01 21:58:18 (GMT)
commit86edb140570f0e1761e6444d78d2a027d58dd240 (patch)
treece32016c0fd213fdce51458bb47547c59ea2f462 /Lib/test
parent6290bcfc2552b03a4d36ffd773d152d0cfb8a571 (diff)
downloadcpython-86edb140570f0e1761e6444d78d2a027d58dd240.zip
cpython-86edb140570f0e1761e6444d78d2a027d58dd240.tar.gz
cpython-86edb140570f0e1761e6444d78d2a027d58dd240.tar.bz2
Merged revisions 83461 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/release27-maint ................ r83461 | georg.brandl | 2010-08-01 23:18:52 +0200 (So, 01 Aug 2010) | 9 lines Merged revisions 83201 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r83201 | georg.brandl | 2010-07-28 10:19:35 +0200 (Mi, 28 Jul 2010) | 1 line #9354: Provide getsockopt() in asyncore file_wrapper(). Patch by Lukas Langa. ........ ................
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_asyncore.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_asyncore.py b/Lib/test/test_asyncore.py
index ebc2adb..56f1939 100644
--- a/Lib/test/test_asyncore.py
+++ b/Lib/test/test_asyncore.py
@@ -412,6 +412,17 @@ if hasattr(asyncore, 'file_wrapper'):
w.close()
self.assertEqual(file(TESTFN).read(), self.d + d1 + d2)
+ def test_dispatcher(self):
+ fd = os.open(TESTFN, os.O_RDONLY)
+ data = []
+ class FileDispatcher(asyncore.file_dispatcher):
+ def handle_read(self):
+ data.append(self.recv(29))
+ s = FileDispatcher(fd)
+ os.close(fd)
+ asyncore.loop(timeout=0.01, use_poll=True, count=2)
+ self.assertEqual("".join(data), self.d)
+
def test_main():
tests = [HelperFunctionTests, DispatcherTests, DispatcherWithSendTests,