mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
merge: #20155: use fake HTTP method names so windows doesn't hang the tests.
This commit is contained in:
commit
24a3c72638
3 changed files with 8 additions and 2 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue