mirror of
https://github.com/python/cpython.git
synced 2025-08-22 17:55:18 +00:00
bpo-40321: Add missing test, slightly expand documentation (GH-28760)
This commit is contained in:
parent
61892c0476
commit
f528045f69
4 changed files with 12 additions and 8 deletions
|
@ -1163,7 +1163,7 @@ class HandlerTests(unittest.TestCase):
|
|||
o = h.parent = MockOpener()
|
||||
|
||||
# ordinary redirect behaviour
|
||||
for code in 301, 302, 303, 307:
|
||||
for code in 301, 302, 303, 307, 308:
|
||||
for data in None, "blah\nblah\n":
|
||||
method = getattr(h, "http_error_%s" % code)
|
||||
req = Request(from_url, data)
|
||||
|
@ -1176,8 +1176,8 @@ class HandlerTests(unittest.TestCase):
|
|||
method(req, MockFile(), code, "Blah",
|
||||
MockHeaders({"location": to_url}))
|
||||
except urllib.error.HTTPError:
|
||||
# 307 in response to POST requires user OK
|
||||
self.assertEqual(code, 307)
|
||||
# 307 and 308 in response to POST require user OK
|
||||
self.assertIn(code, (307, 308))
|
||||
self.assertIsNotNone(data)
|
||||
self.assertEqual(o.req.get_full_url(), to_url)
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue