mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Issue #22247: Add NNTPError to nntplib.__all__.
This commit is contained in:
parent
fc4ead2451
commit
96756b6a27
3 changed files with 16 additions and 7 deletions
|
@ -80,8 +80,8 @@ from email.header import decode_header as _email_decode_header
|
||||||
from socket import _GLOBAL_DEFAULT_TIMEOUT
|
from socket import _GLOBAL_DEFAULT_TIMEOUT
|
||||||
|
|
||||||
__all__ = ["NNTP",
|
__all__ = ["NNTP",
|
||||||
"NNTPReplyError", "NNTPTemporaryError", "NNTPPermanentError",
|
"NNTPError", "NNTPReplyError", "NNTPTemporaryError",
|
||||||
"NNTPProtocolError", "NNTPDataError",
|
"NNTPPermanentError", "NNTPProtocolError", "NNTPDataError",
|
||||||
"decode_header",
|
"decode_header",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
@ -1412,11 +1412,18 @@ class MiscTests(unittest.TestCase):
|
||||||
def test_ssl_support(self):
|
def test_ssl_support(self):
|
||||||
self.assertTrue(hasattr(nntplib, 'NNTP_SSL'))
|
self.assertTrue(hasattr(nntplib, 'NNTP_SSL'))
|
||||||
|
|
||||||
def test_main():
|
|
||||||
tests = [MiscTests, NNTPv1Tests, NNTPv2Tests, CapsAfterLoginNNTPv2Tests,
|
|
||||||
SendReaderNNTPv2Tests, NetworkedNNTPTests, NetworkedNNTP_SSLTests]
|
|
||||||
support.run_unittest(*tests)
|
|
||||||
|
|
||||||
|
class PublicAPITests(unittest.TestCase):
|
||||||
|
"""Ensures that the correct values are exposed in the public API."""
|
||||||
|
|
||||||
|
def test_module_all_attribute(self):
|
||||||
|
self.assertTrue(hasattr(nntplib, '__all__'))
|
||||||
|
target_api = ['NNTP', 'NNTPError', 'NNTPReplyError',
|
||||||
|
'NNTPTemporaryError', 'NNTPPermanentError',
|
||||||
|
'NNTPProtocolError', 'NNTPDataError', 'decode_header']
|
||||||
|
if ssl is not None:
|
||||||
|
target_api.append('NNTP_SSL')
|
||||||
|
self.assertEqual(set(nntplib.__all__), set(target_api))
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
test_main()
|
unittest.main()
|
||||||
|
|
|
@ -32,6 +32,8 @@ Core and Builtins
|
||||||
Library
|
Library
|
||||||
-------
|
-------
|
||||||
|
|
||||||
|
- Issue #22247: Add NNTPError to nntplib.__all__.
|
||||||
|
|
||||||
- Issue #4180: The warnings registries are now reset when the filters
|
- Issue #4180: The warnings registries are now reset when the filters
|
||||||
are modified.
|
are modified.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue