summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httpservers.py
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2015-02-13 18:48:15 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2015-02-13 18:48:15 (GMT)
commit366c570d1f48df0f06707e34472b626bc97f03e3 (patch)
tree43b6c5bfb466b45544a6f3b7f9d6067363998b69 /Lib/test/test_httpservers.py
parenta25c542c476b84b30a7172d5b4f7e2c82330f6f4 (diff)
downloadcpython-366c570d1f48df0f06707e34472b626bc97f03e3.zip
cpython-366c570d1f48df0f06707e34472b626bc97f03e3.tar.gz
cpython-366c570d1f48df0f06707e34472b626bc97f03e3.tar.bz2
Issue #23418: Add missing entries to http.server.__all__.
Patch by Martin Panter.
Diffstat (limited to 'Lib/test/test_httpservers.py')
-rw-r--r--Lib/test/test_httpservers.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_httpservers.py b/Lib/test/test_httpservers.py
index 569341d..67a4654 100644
--- a/Lib/test/test_httpservers.py
+++ b/Lib/test/test_httpservers.py
@@ -760,6 +760,19 @@ class SimpleHTTPRequestHandlerTestCase(unittest.TestCase):
self.assertEqual(path, self.translated)
+class MiscTestCase(unittest.TestCase):
+ def test_all(self):
+ expected = []
+ blacklist = {'executable', 'nobody_uid', 'test'}
+ for name in dir(server):
+ if name.startswith('_') or name in blacklist:
+ continue
+ module_object = getattr(server, name)
+ if getattr(module_object, '__module__', None) == 'http.server':
+ expected.append(name)
+ self.assertCountEqual(server.__all__, expected)
+
+
def test_main(verbose=None):
cwd = os.getcwd()
try:
@@ -769,6 +782,7 @@ def test_main(verbose=None):
SimpleHTTPServerTestCase,
CGIHTTPServerTestCase,
SimpleHTTPRequestHandlerTestCase,
+ MiscTestCase,
)
finally:
os.chdir(cwd)