bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481)

This commit is contained in:
Rémi Lapeyre 2019-05-27 15:43:45 +02:00 committed by Cheryl Sabella
parent 1f39c28e48
commit 674ee12600
6 changed files with 24 additions and 19 deletions

View file

@ -1169,8 +1169,10 @@ class Utility_Tests(unittest.TestCase):
'http://www.python.org/medi\u00e6val')
def test_unwrap(self):
url = urllib.parse._unwrap('<URL:type://host/path>')
self.assertEqual(url, 'type://host/path')
for wrapped_url in ('<URL:scheme://host/path>', '<scheme://host/path>',
'URL:scheme://host/path', 'scheme://host/path'):
url = urllib.parse.unwrap(wrapped_url)
self.assertEqual(url, 'scheme://host/path')
class DeprecationTest(unittest.TestCase):
@ -1251,12 +1253,6 @@ class DeprecationTest(unittest.TestCase):
self.assertEqual(str(cm.warning),
'urllib.parse.to_bytes() is deprecated as of 3.8')
def test_unwrap(self):
with self.assertWarns(DeprecationWarning) as cm:
urllib.parse.unwrap('')
self.assertEqual(str(cm.warning),
'urllib.parse.unwrap() is deprecated as of 3.8')
if __name__ == "__main__":
unittest.main()