changeset: 92489:e21b0bbc06ea parent: 92487:52b498e03df4 parent: 92488:eb9eac80c17a user: Berker Peksag date: Sat Sep 20 08:54:32 2014 +0300 files: Misc/NEWS description: Issue #22247: Add NNTPError to nntplib.__all__. diff -r 52b498e03df4 -r e21b0bbc06ea Lib/nntplib.py --- a/Lib/nntplib.py Fri Sep 19 21:06:23 2014 -0700 +++ b/Lib/nntplib.py Sat Sep 20 08:54:32 2014 +0300 @@ -80,8 +80,8 @@ from socket import _GLOBAL_DEFAULT_TIMEOUT __all__ = ["NNTP", - "NNTPReplyError", "NNTPTemporaryError", "NNTPPermanentError", - "NNTPProtocolError", "NNTPDataError", + "NNTPError", "NNTPReplyError", "NNTPTemporaryError", + "NNTPPermanentError", "NNTPProtocolError", "NNTPDataError", "decode_header", ] diff -r 52b498e03df4 -r e21b0bbc06ea Lib/test/test_nntplib.py --- a/Lib/test/test_nntplib.py Fri Sep 19 21:06:23 2014 -0700 +++ b/Lib/test/test_nntplib.py Sat Sep 20 08:54:32 2014 +0300 @@ -1412,11 +1412,18 @@ def test_ssl_support(self): 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__": - test_main() + unittest.main() diff -r 52b498e03df4 -r e21b0bbc06ea Misc/NEWS --- a/Misc/NEWS Fri Sep 19 21:06:23 2014 -0700 +++ b/Misc/NEWS Sat Sep 20 08:54:32 2014 +0300 @@ -137,6 +137,8 @@ Library ------- +- Issue #22247: Add NNTPError to nntplib.__all__. + - Issue #22366: urllib.request.urlopen will accept a context object (SSLContext) as an argument which will then used be for HTTPS connection. Patch by Alex Gaynor.