mirror of
https://github.com/python/cpython.git
synced 2026-01-04 14:32:21 +00:00
Create http package. #2883.
This commit is contained in:
parent
744c2cd325
commit
2442015af2
50 changed files with 930 additions and 1203 deletions
|
|
@ -4,16 +4,15 @@
|
|||
Josip Dzolonga, and Michael Otteneder for the 2007/08 GHOP contest.
|
||||
"""
|
||||
|
||||
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
|
||||
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||
from CGIHTTPServer import CGIHTTPRequestHandler
|
||||
from http.server import BaseHTTPRequestHandler, HTTPServer, \
|
||||
SimpleHTTPRequestHandler, CGIHTTPRequestHandler
|
||||
|
||||
import os
|
||||
import sys
|
||||
import base64
|
||||
import shutil
|
||||
import urllib
|
||||
import httplib
|
||||
import http.client
|
||||
import tempfile
|
||||
import threading
|
||||
|
||||
|
|
@ -59,7 +58,7 @@ def tearDown(self):
|
|||
self.thread.stop()
|
||||
|
||||
def request(self, uri, method='GET', body=None, headers={}):
|
||||
self.connection = httplib.HTTPConnection('localhost', self.PORT)
|
||||
self.connection = http.client.HTTPConnection('localhost', self.PORT)
|
||||
self.connection.request(method, uri, body, headers)
|
||||
return self.connection.getresponse()
|
||||
|
||||
|
|
@ -92,7 +91,7 @@ def do_CUSTOM(self):
|
|||
|
||||
def setUp(self):
|
||||
BaseTestCase.setUp(self)
|
||||
self.con = httplib.HTTPConnection('localhost', self.PORT)
|
||||
self.con = http.client.HTTPConnection('localhost', self.PORT)
|
||||
self.con.connect()
|
||||
|
||||
def test_command(self):
|
||||
|
|
@ -343,7 +342,7 @@ def test_authorization(self):
|
|||
def test_main(verbose=None):
|
||||
try:
|
||||
cwd = os.getcwd()
|
||||
support.run_unittest(#BaseHTTPServerTestCase,
|
||||
support.run_unittest(BaseHTTPServerTestCase,
|
||||
SimpleHTTPServerTestCase,
|
||||
CGIHTTPServerTestCase
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue