mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
bpo-35397: Remove deprecation and document urllib.parse.unwrap (GH-11481)
This commit is contained in:
parent
1f39c28e48
commit
674ee12600
6 changed files with 24 additions and 19 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue