Kaydet (Commit) 315d8457 authored tarafından Neal Norwitz's avatar Neal Norwitz

Revert revisions 57472, 57474, and 57477 which disabled some tests

when the email package was removed.  Email was restored, so restore the tests.
üst 8b3d6596
...@@ -175,7 +175,7 @@ class PyclbrTest(TestCase): ...@@ -175,7 +175,7 @@ class PyclbrTest(TestCase):
cm('pydoc') cm('pydoc')
# Tests for modules inside packages # Tests for modules inside packages
#cm('email.parser') cm('email.parser')
cm('test.test_pyclbr') cm('test.test_pyclbr')
......
...@@ -439,7 +439,6 @@ class PyZipFileTests(unittest.TestCase): ...@@ -439,7 +439,6 @@ class PyZipFileTests(unittest.TestCase):
zipfp.close() zipfp.close()
def testWritePythonPackage(self): def testWritePythonPackage(self):
return # XXX(nnorwitz): disable test until email is checked in again.
import email import email
packagedir = os.path.dirname(email.__file__) packagedir = os.path.dirname(email.__file__)
......
...@@ -403,7 +403,7 @@ class URLopener: ...@@ -403,7 +403,7 @@ class URLopener:
def open_local_file(self, url): def open_local_file(self, url):
"""Use local file.""" """Use local file."""
import mimetypes, mimetools #, email.utils import mimetypes, mimetools, email.utils
from io import StringIO from io import StringIO
host, file = splithost(url) host, file = splithost(url)
localname = url2pathname(file) localname = url2pathname(file)
...@@ -412,17 +412,7 @@ class URLopener: ...@@ -412,17 +412,7 @@ class URLopener:
except OSError as e: except OSError as e:
raise IOError(e.errno, e.strerror, e.filename) raise IOError(e.errno, e.strerror, e.filename)
size = stats.st_size size = stats.st_size
# XXX(nnorwitz): inline formatdate until it is restored. modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
#modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
now, zone = time.gmtime(stats.st_mtime), 'GMT'
modified = '%s, %02d %s %04d %02d:%02d:%02d %s' % (
['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][now[6]],
now[2],
['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][now[1] - 1],
now[0], now[3], now[4], now[5],
zone)
mtype = mimetypes.guess_type(url)[0] mtype = mimetypes.guess_type(url)[0]
headers = mimetools.Message(StringIO( headers = mimetools.Message(StringIO(
'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' % 'Content-Type: %s\nContent-Length: %d\nLast-modified: %s\n' %
......
...@@ -1204,7 +1204,7 @@ class FileHandler(BaseHandler): ...@@ -1204,7 +1204,7 @@ class FileHandler(BaseHandler):
# not entirely sure what the rules are here # not entirely sure what the rules are here
def open_local_file(self, req): def open_local_file(self, req):
#import email.utils import email.utils
import mimetypes import mimetypes
host = req.get_host() host = req.get_host()
file = req.get_selector() file = req.get_selector()
...@@ -1212,17 +1212,7 @@ class FileHandler(BaseHandler): ...@@ -1212,17 +1212,7 @@ class FileHandler(BaseHandler):
try: try:
stats = os.stat(localfile) stats = os.stat(localfile)
size = stats.st_size size = stats.st_size
#modified = email.utils.formatdate(stats.st_mtime, usegmt=True) modified = email.utils.formatdate(stats.st_mtime, usegmt=True)
# XXX(nnorwitz): inline formatdate until it is restored.
now, zone = time.gmtime(stats.st_mtime), 'GMT'
modified = '%s, %02d %s %04d %02d:%02d:%02d %s' % (
['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'][now[6]],
now[2],
['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'][now[1] - 1],
now[0], now[3], now[4], now[5],
zone)
mtype = mimetypes.guess_type(file)[0] mtype = mimetypes.guess_type(file)[0]
headers = mimetools.Message(StringIO( headers = mimetools.Message(StringIO(
'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' %
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment