diff options
author | Berker Peksag <berker.peksag@gmail.com> | 2014-09-20 05:54:32 (GMT) |
---|---|---|
committer | Berker Peksag <berker.peksag@gmail.com> | 2014-09-20 05:54:32 (GMT) |
commit | bdfeb0387dce957303ec822337e817e1207c5a36 (patch) | |
tree | a6c0e52cc7c1066e0855bba63040f243e70aa2e6 /Lib/test | |
parent | 257c6cb86eab89c7708d05626589f815f4033d77 (diff) | |
parent | 96756b6a2712830cdbb29f5eb125b7aef0ee187c (diff) | |
download | cpython-bdfeb0387dce957303ec822337e817e1207c5a36.zip cpython-bdfeb0387dce957303ec822337e817e1207c5a36.tar.gz cpython-bdfeb0387dce957303ec822337e817e1207c5a36.tar.bz2 |
Issue #22247: Add NNTPError to nntplib.__all__.
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_nntplib.py | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/Lib/test/test_nntplib.py b/Lib/test/test_nntplib.py index 71a4ec0..fb216c1 100644 --- a/Lib/test/test_nntplib.py +++ b/Lib/test/test_nntplib.py @@ -1412,11 +1412,18 @@ class MiscTests(unittest.TestCase): 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() |