]> granicus.if.org Git - python/commitdiff
#20155: use fake HTTP method names so windows doesn't hang the tests.
authorR David Murray <rdmurray@bitdance.com>
Tue, 24 Jun 2014 20:39:49 +0000 (16:39 -0400)
committerR David Murray <rdmurray@bitdance.com>
Tue, 24 Jun 2014 20:39:49 +0000 (16:39 -0400)
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.

Lib/test/test_httpservers.py
Misc/ACKS
Misc/NEWS

index 493fade98567efa7e7a5ba8e0e17c4f28081d9c0..15dec1c8d0452cc8830196c9d02a2d5c45ee5262 100644 (file)
@@ -125,7 +125,7 @@ class BaseHTTPServerTestCase(BaseTestCase):
 
     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)
@@ -152,8 +152,9 @@ class BaseHTTPServerTestCase(BaseTestCase):
         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)
index 908f47b59085b4ff20fcfc6078ed12d1e202512d..fa6b1f6e4d5b90083225b8040e3ddb36b1ab28ec 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -29,6 +29,7 @@ Yaniv Aknin
 Jyrki Alakuijala
 Steve Alexander
 Fred Allen
+Jeff Allen
 Ray Allen
 Billy G. Allie
 Kevin Altis
index 52c1e0e0aee66ea0cafb8d9c851ac9601dd49ad0..8598c3fddecdeba5d2869852c0b5409ad539eacf 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -133,6 +133,10 @@ IDLE
 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.