]> 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:49:24 +0000 (16:49 -0400)
committerR David Murray <rdmurray@bitdance.com>
Tue, 24 Jun 2014 20:49:24 +0000 (16:49 -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 6a23bb2e0df838e8ef8f37ae8909d3daa175e552..c1c1a2d4068564f6832e23f04c503cb5732424fa 100644 (file)
@@ -189,7 +189,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)
@@ -216,8 +216,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 33d5e3451487cce858cf4477b5c7598a8d131390..983e048f93f83c06d7ac2769b4d6928b9f0b5f88 100644 (file)
--- a/Misc/ACKS
+++ b/Misc/ACKS
@@ -28,6 +28,7 @@ Yaniv Aknin
 Jyrki Alakuijala
 Steve Alexander
 Fred Allen
+Jeff Allen
 Ray Allen
 Billy G. Allie
 Kevin Altis
index a077b4d6da2165f1ae151f7f9882d411a64aaf94..0f0f054489d8f9c79ececc770b8d5339f522853d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -100,6 +100,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.