summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2015-02-15 12:02:15 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2015-02-15 12:02:15 (GMT)
commit56abe39052a68265cf8328bb49f412a42bd53a74 (patch)
treec56b8d615bfcca592c497280037450eacc93d2f0 /Lib
parent85c3033670d493d17e633261793e83226a6a0f61 (diff)
parent3cd30c2ceeaeabe0486a2467fd11cdc008bf6f67 (diff)
downloadcpython-56abe39052a68265cf8328bb49f412a42bd53a74.zip
cpython-56abe39052a68265cf8328bb49f412a42bd53a74.tar.gz
cpython-56abe39052a68265cf8328bb49f412a42bd53a74.tar.bz2
Merge heads
Diffstat (limited to 'Lib')
-rw-r--r--Lib/http/server.py5
-rw-r--r--Lib/test/test_gdb.py2
-rw-r--r--Lib/test/test_httpservers.py14
-rw-r--r--Lib/test/test_zipfile.py8
4 files changed, 28 insertions, 1 deletions
diff --git a/Lib/http/server.py b/Lib/http/server.py
index cfa29f4..a27890e 100644
--- a/Lib/http/server.py
+++ b/Lib/http/server.py
@@ -82,7 +82,10 @@ XXX To do:
__version__ = "0.6"
-__all__ = ["HTTPServer", "BaseHTTPRequestHandler"]
+__all__ = [
+ "HTTPServer", "BaseHTTPRequestHandler",
+ "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler",
+]
import html
import http.client
diff --git a/Lib/test/test_gdb.py b/Lib/test/test_gdb.py
index aaa5c69..c57875c 100644
--- a/Lib/test/test_gdb.py
+++ b/Lib/test/test_gdb.py
@@ -190,6 +190,8 @@ class DebuggerTests(unittest.TestCase):
'linux-vdso.so',
'warning: Could not load shared library symbols for '
'linux-gate.so',
+ 'warning: Could not load shared library symbols for '
+ 'linux-vdso64.so',
'Do you need "set solib-search-path" or '
'"set sysroot"?',
'warning: Source file is more recent than executable.',
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)
diff --git a/Lib/test/test_zipfile.py b/Lib/test/test_zipfile.py
index 76e32fb..4633fe6 100644
--- a/Lib/test/test_zipfile.py
+++ b/Lib/test/test_zipfile.py
@@ -648,7 +648,12 @@ class PyZipFileTests(unittest.TestCase):
if name + 'o' not in namelist:
self.assertIn(name + 'c', namelist)
+ def requiresWriteAccess(self, path):
+ if not os.access(path, os.W_OK, effective_ids=True):
+ self.skipTest('requires write access to the installed location')
+
def test_write_pyfile(self):
+ self.requiresWriteAccess(os.path.dirname(__file__))
with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
fn = __file__
if fn.endswith('.pyc') or fn.endswith('.pyo'):
@@ -680,6 +685,7 @@ class PyZipFileTests(unittest.TestCase):
def test_write_python_package(self):
import email
packagedir = os.path.dirname(email.__file__)
+ self.requiresWriteAccess(packagedir)
with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
zipfp.writepy(packagedir)
@@ -693,6 +699,7 @@ class PyZipFileTests(unittest.TestCase):
def test_write_filtered_python_package(self):
import test
packagedir = os.path.dirname(test.__file__)
+ self.requiresWriteAccess(packagedir)
with TemporaryFile() as t, zipfile.PyZipFile(t, "w") as zipfp:
@@ -721,6 +728,7 @@ class PyZipFileTests(unittest.TestCase):
def test_write_with_optimization(self):
import email
packagedir = os.path.dirname(email.__file__)
+ self.requiresWriteAccess(packagedir)
# use .pyc if running test in optimization mode,
# use .pyo if running test in debug mode
optlevel = 1 if __debug__ else 0