[Python-checkins] cpython (2.7): #20155: use fake HTTP method names so windows doesn't hang the tests.

r.david.murray python-checkins at python.org
Tue Jun 24 22:51:29 CEST 2014


http://hg.python.org/cpython/rev/b0526da56c54
changeset:   91364:b0526da56c54
branch:      2.7
parent:      91361:30063f97a44d
user:        R David Murray <rdmurray at bitdance.com>
date:        Tue Jun 24 16:49:24 2014 -0400
summary:
  #20155: use fake HTTP method names so windows doesn't hang the tests.

Windows was seeing the 'GET' generated by these tests as invalid and forcibly
closing the socket, causing the test to fail.

Patch by Jeff Allen.

files:
  Lib/test/test_httpservers.py |  5 +++--
  Misc/ACKS                    |  1 +
  Misc/NEWS                    |  4 ++++
  3 files changed, 8 insertions(+), 2 deletions(-)


diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -189,7 +189,7 @@
 
     def test_request_line_trimming(self):
         self.con._http_vsn_str = 'HTTP/1.1\n'
-        self.con.putrequest('GET', '/')
+        self.con.putrequest('XYZBOGUS', '/')
         self.con.endheaders()
         res = self.con.getresponse()
         self.assertEqual(res.status, 501)
@@ -216,8 +216,9 @@
         self.assertEqual(res.status, 501)
 
     def test_version_none(self):
+        # Test that a valid method is rejected when not HTTP/1.x
         self.con._http_vsn_str = ''
-        self.con.putrequest('PUT', '/')
+        self.con.putrequest('CUSTOM', '/')
         self.con.endheaders()
         res = self.con.getresponse()
         self.assertEqual(res.status, 400)
diff --git a/Misc/ACKS b/Misc/ACKS
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -28,6 +28,7 @@
 Jyrki Alakuijala
 Steve Alexander
 Fred Allen
+Jeff Allen
 Ray Allen
 Billy G. Allie
 Kevin Altis
diff --git a/Misc/NEWS b/Misc/NEWS
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -100,6 +100,10 @@
 Tests
 -----
 
+- Issue #20155: Changed HTTP method names in failing tests in test_httpservers
+  so that packet filtering software (specifically Windows Base Filtering Engine)
+  does not interfere with the transaction semantics expected by the tests.
+
 - Issue #19493: Refactored the ctypes test package to skip tests explicitly
   rather than silently.
 

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list