summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_urllib_response.py
diff options
context:
space:
mode:
authorAshwin Ramaswami <aramaswamis@gmail.com>2019-09-13 11:40:08 (GMT)
committerStéphane Wirtel <stephane@wirtel.be>2019-09-13 11:40:07 (GMT)
commitff2e18286560e981f4e09afb0d2448ea994414d8 (patch)
tree9a339486705cfbc5d6b183ffdf11ad686b256b1d /Lib/test/test_urllib_response.py
parentbb41147eab15a2958f4ad38261e5bf608f6ace1b (diff)
downloadcpython-ff2e18286560e981f4e09afb0d2448ea994414d8.zip
cpython-ff2e18286560e981f4e09afb0d2448ea994414d8.tar.gz
cpython-ff2e18286560e981f4e09afb0d2448ea994414d8.tar.bz2
bpo-12707: deprecate info(), geturl(), getcode() methods in favor of headers, url, and status properties for HTTPResponse and addinfourl (GH-11447)
Co-Authored-By: epicfaace <aramaswamis@gmail.com>
Diffstat (limited to 'Lib/test/test_urllib_response.py')
-rw-r--r--Lib/test/test_urllib_response.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_urllib_response.py b/Lib/test/test_urllib_response.py
index 0eb5942..73d2ef0 100644
--- a/Lib/test/test_urllib_response.py
+++ b/Lib/test/test_urllib_response.py
@@ -42,6 +42,7 @@ class TestResponse(unittest.TestCase):
def test_addinfo(self):
info = urllib.response.addinfo(self.fp, self.test_headers)
self.assertEqual(info.info(), self.test_headers)
+ self.assertEqual(info.headers, self.test_headers)
def test_addinfourl(self):
url = "http://www.python.org"
@@ -51,6 +52,9 @@ class TestResponse(unittest.TestCase):
self.assertEqual(infourl.info(), self.test_headers)
self.assertEqual(infourl.geturl(), url)
self.assertEqual(infourl.getcode(), code)
+ self.assertEqual(infourl.headers, self.test_headers)
+ self.assertEqual(infourl.url, url)
+ self.assertEqual(infourl.status, code)
def tearDown(self):
self.sock.close()