Index: Lib/test/test_httpservers.py =================================================================== --- Lib/test/test_httpservers.py (revision 81970) +++ Lib/test/test_httpservers.py (working copy) @@ -4,11 +4,6 @@ Josip Dzolonga, and Michael Otteneder for the 2007/08 GHOP contest. """ -from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer -from SimpleHTTPServer import SimpleHTTPRequestHandler -from CGIHTTPServer import CGIHTTPRequestHandler -import CGIHTTPServer - import os import sys import base64 @@ -16,8 +11,12 @@ import urllib import httplib import tempfile - +import CGIHTTPServer import unittest +from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer +from SimpleHTTPServer import SimpleHTTPRequestHandler +from CGIHTTPServer import CGIHTTPRequestHandler +from email.utils import formatdate from test import test_support threading = test_support.import_module('threading') @@ -191,6 +190,13 @@ self.assertEqual(res.status, 999) +class BaseHTTPServermiscTestCase(unittest.TestCase): + def test_date_time_string(self): + timestamp = 1276439224.089797 # just a random time + self.assertEqual(formatdate(timestamp, usegmt=True), + 'Sun, 13 Jun 2010 14:27:04 GMT') + + class SimpleHTTPServerTestCase(BaseTestCase): class request_handler(NoLogRequestHandler, SimpleHTTPRequestHandler): pass @@ -403,6 +409,7 @@ try: cwd = os.getcwd() test_support.run_unittest(BaseHTTPServerTestCase, + BaseHTTPServermiscTestCase, SimpleHTTPServerTestCase, CGIHTTPServerTestCase )