summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib2.py
diff options
context:
space:
mode:
authorƁukasz Langa <lukasz@langa.pl>2021-10-06 15:28:16 (GMT)
committerGitHub <noreply@github.com>2021-10-06 15:28:16 (GMT)
commitf528045f695f7483d955a1eae4c1df68b1b4cacd (patch)
tree0aa89e755f8672aca1a635762dbaf0fef795a072 /Lib/test/test_urllib2.py
parent61892c04764e1f3a659bbd09e6373687a27d36e2 (diff)
downloadcpython-f528045f695f7483d955a1eae4c1df68b1b4cacd.zip
cpython-f528045f695f7483d955a1eae4c1df68b1b4cacd.tar.gz
cpython-f528045f695f7483d955a1eae4c1df68b1b4cacd.tar.bz2
bpo-40321: Add missing test, slightly expand documentation (GH-28760)
Diffstat (limited to 'Lib/test/test_urllib2.py')
-rw-r--r--Lib/test/test_urllib2.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_urllib2.py b/Lib/test/test_urllib2.py
index 9db23e6..a2b1340 100644
--- a/Lib/test/test_urllib2.py
+++ b/Lib/test/test_urllib2.py
@@ -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: