Back to index

moin  1.9.0~rc2
Public Member Functions | Public Attributes | Static Public Attributes
MoinMoin.web.request.TestRequest Class Reference
Inheritance diagram for MoinMoin.web.request.TestRequest:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.web.request.TestRequest:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def in_data
def in_headers

Public Attributes

 href
 abs_href
 response
 status_code

Static Public Attributes

 charset = config.charset
string encoding_errors = 'replace'
string default_mimetype = 'text/html'
 given_config = None
 headers = None
 in_stream = RequestBase.stream

Detailed Description

Request with customized `environ` for test purposes. 

Definition at line 61 of file request.py.


Constructor & Destructor Documentation

def MoinMoin.web.request.TestRequest.__init__ (   self,
  path = "/",
  query_string = None,
  method = 'GET',
  content_type = None,
  content_length = 0,
  form_data = None,
  environ_overrides = None 
)
For parameter reference see the documentation of the werkzeug
package, especially the functions `url_encode` and `create_environ`.

Definition at line 65 of file request.py.

00065 
00066                  environ_overrides=None):
00067         """
00068         For parameter reference see the documentation of the werkzeug
00069         package, especially the functions `url_encode` and `create_environ`.
00070         """
00071         input_stream = None
00072 
00073         if form_data is not None:
00074             form_data = url_encode(form_data)
00075             content_type = 'application/x-www-form-urlencoded'
00076             content_length = len(form_data)
00077             input_stream = StringIO(form_data)
00078         environ = create_environ(path=path, query_string=query_string,
00079                                  method=method, input_stream=input_stream,
00080                                  content_type=content_type,
00081                                  content_length=content_length)
00082 
00083         environ['HTTP_USER_AGENT'] = 'MoinMoin/TestRequest'
00084         # must have reverse lookup or tests will be extremely slow:
00085         environ['REMOTE_ADDR'] = '127.0.0.1'
00086 
00087         if environ_overrides:
00088             environ.update(environ_overrides)
00089 
00090         super(TestRequest, self).__init__(environ)

Here is the call graph for this function:


Member Function Documentation

def MoinMoin.web.request.Request.in_data (   self) [inherited]

Definition at line 53 of file request.py.

00053 
00054     def in_data(self):
00055         return self.in_stream.read()

def MoinMoin.web.request.Request.in_headers (   self) [inherited]

Definition at line 57 of file request.py.

00057 
00058     def in_headers(self):
00059         return EnvironHeaders(self.environ)
00060 


Member Data Documentation

Definition at line 45 of file request.py.

Definition at line 33 of file request.py.

string MoinMoin.web.request.Request.default_mimetype = 'text/html' [static, inherited]

Definition at line 35 of file request.py.

string MoinMoin.web.request.Request.encoding_errors = 'replace' [static, inherited]

Definition at line 34 of file request.py.

MoinMoin.web.request.Request.given_config = None [static, inherited]

Definition at line 36 of file request.py.

MoinMoin.web.request.Request.headers = None [static, inherited]

Definition at line 39 of file request.py.

Definition at line 44 of file request.py.

MoinMoin.web.request.Request.in_stream = RequestBase.stream [static, inherited]

Definition at line 50 of file request.py.

Definition at line 47 of file request.py.

Definition at line 48 of file request.py.


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