Back to index

python3.2  3.2.2
Public Member Functions | Public Attributes | Private Attributes
test.test_urllib2.MockHTTPClass Class Reference

List of all members.

Public Member Functions

def __init__
def __call__
def set_debuglevel
def set_tunnel
def request
def getresponse
def close

Public Attributes

 level
 req_headers
 data
 raise_on_endheaders
 host
 timeout
 method
 selector

Private Attributes

 _tunnel_headers
 _tunnel_host
 _tunnel_port

Detailed Description

Definition at line 282 of file test_urllib2.py.


Constructor & Destructor Documentation

Definition at line 283 of file test_urllib2.py.

00283 
00284     def __init__(self):
00285         self.level = 0
00286         self.req_headers = []
00287         self.data = None
00288         self.raise_on_endheaders = False
00289         self._tunnel_headers = {}

Here is the caller graph for this function:


Member Function Documentation

Definition at line 290 of file test_urllib2.py.

00290 
00291     def __call__(self, host, timeout=socket._GLOBAL_DEFAULT_TIMEOUT):
00292         self.host = host
00293         self.timeout = timeout
00294         return self

Definition at line 320 of file test_urllib2.py.

00320 
00321     def close(self):
00322         pass

Here is the caller graph for this function:

Definition at line 317 of file test_urllib2.py.

00317 
00318     def getresponse(self):
00319         return MockHTTPResponse(MockFile(), {}, 200, "OK")

def test.test_urllib2.MockHTTPClass.request (   self,
  method,
  url,
  body = None,
  headers = None 
)

Definition at line 306 of file test_urllib2.py.

00306 
00307     def request(self, method, url, body=None, headers=None):
00308         self.method = method
00309         self.selector = url
00310         if headers is not None:
00311             self.req_headers += headers.items()
00312         self.req_headers.sort()
00313         if body:
00314             self.data = body
00315         if self.raise_on_endheaders:
00316             import socket
            raise socket.error()

Definition at line 295 of file test_urllib2.py.

00295 
00296     def set_debuglevel(self, level):
00297         self.level = level

def test.test_urllib2.MockHTTPClass.set_tunnel (   self,
  host,
  port = None,
  headers = None 
)

Definition at line 298 of file test_urllib2.py.

00298 
00299     def set_tunnel(self, host, port=None, headers=None):
00300         self._tunnel_host = host
00301         self._tunnel_port = port
00302         if headers:
00303             self._tunnel_headers = headers
00304         else:
00305             self._tunnel_headers.clear()


Member Data Documentation

Definition at line 288 of file test_urllib2.py.

Definition at line 299 of file test_urllib2.py.

Definition at line 300 of file test_urllib2.py.

Definition at line 286 of file test_urllib2.py.

Definition at line 291 of file test_urllib2.py.

Definition at line 284 of file test_urllib2.py.

Definition at line 307 of file test_urllib2.py.

Definition at line 287 of file test_urllib2.py.

Definition at line 285 of file test_urllib2.py.

Definition at line 308 of file test_urllib2.py.

Definition at line 292 of file test_urllib2.py.


The documentation for this class was generated from the following file: