[wwwsearch-commits] r36194 - wwwsearch/mechanize/trunk/test

jjlee at codespeak.net jjlee at codespeak.net
Sun Jan 7 17:15:36 CET 2007


Author: jjlee
Date: Sun Jan  7 17:15:35 2007
New Revision: 36194

Modified:
   wwwsearch/mechanize/trunk/test/test_response.doctest
Log:
Add test for read_complete bug fixed in rev 36082

Modified: wwwsearch/mechanize/trunk/test/test_response.doctest
==============================================================================
--- wwwsearch/mechanize/trunk/test/test_response.doctest	(original)
+++ wwwsearch/mechanize/trunk/test/test_response.doctest	Sun Jan  7 17:15:35 2007
@@ -3,6 +3,7 @@
 .reload() the response if not.
 
 I've noted here the various cases where .read_complete may be set.
+
 >>> text = "To err is human, to moo, bovine.\n"*10
 >>> def get_wrapper():
 ...     import cStringIO
@@ -94,3 +95,18 @@
 True
 >>> wr2.read_complete
 True
+
+
+Fix from -r36082: .read() after .close() used to break
+.read_complete state
+
+>>> from mechanize._response import test_response
+>>> r = test_response(text)
+>>> junk = r.read(64)
+>>> r.close()
+>>> r.read_complete
+False
+>>> r.read()
+''
+>>> r.read_complete
+False


More information about the wwwsearch-commits mailing list