mirror of https://github.com/python/cpython.git
Issue #23411: Added DefragResult, ParseResult, SplitResult, DefragResultBytes,
ParseResultBytes, and SplitResultBytes to urllib.parse.__all__. Patch by Martin Panter.
This commit is contained in:
parent
43a1bed3d2
commit
1515450440
|
@ -840,6 +840,22 @@ def test_Quoter_repr(self):
|
||||||
quoter = urllib.parse.Quoter(urllib.parse._ALWAYS_SAFE)
|
quoter = urllib.parse.Quoter(urllib.parse._ALWAYS_SAFE)
|
||||||
self.assertIn('Quoter', repr(quoter))
|
self.assertIn('Quoter', repr(quoter))
|
||||||
|
|
||||||
|
def test_all(self):
|
||||||
|
expected = []
|
||||||
|
undocumented = {
|
||||||
|
'splitattr', 'splithost', 'splitnport', 'splitpasswd',
|
||||||
|
'splitport', 'splitquery', 'splittag', 'splittype', 'splituser',
|
||||||
|
'splitvalue',
|
||||||
|
'Quoter', 'ResultBase', 'clear_cache', 'to_bytes', 'unwrap',
|
||||||
|
}
|
||||||
|
for name in dir(urllib.parse):
|
||||||
|
if name.startswith('_') or name in undocumented:
|
||||||
|
continue
|
||||||
|
object = getattr(urllib.parse, name)
|
||||||
|
if getattr(object, '__module__', None) == 'urllib.parse':
|
||||||
|
expected.append(name)
|
||||||
|
self.assertCountEqual(urllib.parse.__all__, expected)
|
||||||
|
|
||||||
|
|
||||||
class Utility_Tests(unittest.TestCase):
|
class Utility_Tests(unittest.TestCase):
|
||||||
"""Testcase to test the various utility functions in the urllib."""
|
"""Testcase to test the various utility functions in the urllib."""
|
||||||
|
|
|
@ -34,7 +34,9 @@
|
||||||
__all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
|
__all__ = ["urlparse", "urlunparse", "urljoin", "urldefrag",
|
||||||
"urlsplit", "urlunsplit", "urlencode", "parse_qs",
|
"urlsplit", "urlunsplit", "urlencode", "parse_qs",
|
||||||
"parse_qsl", "quote", "quote_plus", "quote_from_bytes",
|
"parse_qsl", "quote", "quote_plus", "quote_from_bytes",
|
||||||
"unquote", "unquote_plus", "unquote_to_bytes"]
|
"unquote", "unquote_plus", "unquote_to_bytes",
|
||||||
|
"DefragResult", "ParseResult", "SplitResult",
|
||||||
|
"DefragResultBytes", "ParseResultBytes", "SplitResultBytes"]
|
||||||
|
|
||||||
# A classification of schemes ('' means apply by default)
|
# A classification of schemes ('' means apply by default)
|
||||||
uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap',
|
uses_relative = ['ftp', 'http', 'gopher', 'nntp', 'imap',
|
||||||
|
|
|
@ -19,6 +19,10 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #23411: Added DefragResult, ParseResult, SplitResult, DefragResultBytes,
|
||||||
|
ParseResultBytes, and SplitResultBytes to urllib.parse.__all__.
|
||||||
|
Patch by Martin Panter.
|
||||||
|
|
||||||
- Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if
|
- Issue #23881: urllib.request.ftpwrapper constructor now closes the socket if
|
||||||
the FTP connection failed to fix a ResourceWarning.
|
the FTP connection failed to fix a ResourceWarning.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue