diff options
author | R David Murray <rdmurray@bitdance.com> | 2014-06-24 20:39:49 (GMT) |
---|---|---|
committer | R David Murray <rdmurray@bitdance.com> | 2014-06-24 20:39:49 (GMT) |
commit | 14199f939278d67804cf44ef0b9d32f998c62d58 (patch) | |
tree | 44059e9cb8e5c63929e65f0241b0ed77deb89af6 /Lib/test/test_httpservers.py | |
parent | a02f81ff1757a257c7243ff53542d6f4f34668db (diff) | |
download | cpython-14199f939278d67804cf44ef0b9d32f998c62d58.zip cpython-14199f939278d67804cf44ef0b9d32f998c62d58.tar.gz cpython-14199f939278d67804cf44ef0b9d32f998c62d58.tar.bz2 |
#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.
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r-- | Lib/test/test_httpservers.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py index 493fade..15dec1c 100644 --- a/Lib/test/test_httpservers.py +++ b/Lib/test/test_httpservers.py @@ -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) |