Module Expr Str Import alias Import alias Import alias ImportFrom alias ClassDef bases AttributeLoad NameLoad attr body Expr Str FunctionDef arguments args NameParam defaults body Expr Str If BoolOpOr Call NameLoad NameLoad NameLoad Call NameLoad NameLoad AttributeLoad AttributeLoad NameLoad attr attr body Assign NameStore Call AttributeLoad NameLoad attr Return ListComp TupleLoad Call AttributeLoad NameLoad attr NameLoad comprehension TupleStore NameStore NameStore NameLoad decorator_list NameLoad FunctionDef arguments args NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad For TupleStore NameStore NameStore NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMod Str NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults vararg kwarg body Expr Str Assign NameStore Call AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad Return AttributeLoad NameLoad attr decorator_list AugAssignAdd NameStore TupleLoad NameLoad Assign NameStore Call NameLoad NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMod Str NameLoad Assign NameStore Call AttributeLoad Str attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad BinOpMod Str SubscriptLoad NameLoad Slice Num Expr Call AttributeLoad NameLoad attr NameLoad BinOpAdd Call AttributeLoad NameLoad attr NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Dict Assign NameStore Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str FunctionDef arguments args NameParam NameParam defaults body Expr Call NameLoad NameLoad NameLoad Return ListLoad NameLoad decorator_list Return NameLoad decorator_list
N/A N/A Utilities for testing WSGI apps. N/A cStringIO N/A unittest N/A wsgiref.headers google.appengine.tools.devappserver2 request_rewriter WSGITestCase N/A N/A unittest TestCase N/A N/A Base class for tests involving requests to a WSGI application. _normalize_headers N/A N/A headers N/A N/A N/A Normalize a headers set to a list with lowercased names.

    Args:
      headers: A sequence of pairs, a dict or a wsgiref.headers.Headers object.

    Returns:
      headers, converted to a sequence of pairs (if it was not already), with
      all of the header names lowercased.
     N/A N/A N/A isinstance headers dict N/A isinstance headers N/A N/A wsgiref headers Headers N/A N/A headers N/A N/A headers items N/A N/A N/A N/A N/A name lower value N/A N/A name value headers N/A staticmethod assertHeadersEqual N/A N/A self expected actual msg N/A None N/A N/A Tests whether two sets of HTTP headers are equivalent.

    The header sets expected and actual are equal if they both have exactly the
    same set of header name/value pairs. Header names are considered
    case-insensitive, but header values are case sensitive. The order does not
    matter, but duplicate headers (headers of the same name) must be the same in
    both.

    Note: This should be used instead of assertEqual, assertItemsEqual or
    assertDictEqual. Using standard asserts for lists and dicts will be case
    sensitive. Using assert for wsgiref.headers.Headers does reference equality.

    Args:
      expected: A sequence of pairs, a dict or a wsgiref.headers.Headers object.
      actual: A sequence of pairs, a dict or a wsgiref.headers.Headers object.
      msg: A custom error message to display, if the test fails.

    Raises:
      AssertionError if expected and actual are not equal.
     N/A expected N/A N/A self _normalize_headers expected N/A actual N/A N/A self _normalize_headers actual N/A N/A name value actual N/A N/A N/A N/A self assertIsInstance name str N/A header name %r must be a str name N/A N/A N/A self assertIsInstance name str N/A header value %r must be a str value N/A N/A N/A self assertItemsEqual expected actual msg N/A assertResponse N/A N/A self expected_status expected_headers expected_content fn N/A args kwargs N/A N/A Calls fn(*args, <start_response>, **kwargs) and checks the result.

    Args:
      expected_status: The expected HTTP status returned e.g. '200 OK'.
      expected_headers: A dict, list or wsgiref.headers.Headers representing the
          expected generated HTTP headers e.g. {'Content-type': 'text/plain'}.
      expected_content: The expected content generated e.g. 'Hello World'.
      fn: The function to test. This function will be called with
          fn(*args, start_response=<func>, **kwargs) where the start_response
          function verifies that it is called with the correct status and
          headers.
      *args: The positional arguments passed to fn.
      **kwargs: The keyword arguments passed to fn.
     N/A write_buffer N/A N/A cStringIO StringIO start_response N/A N/A status headers exc_info N/A None N/A N/A N/A N/A self assertEqual expected_status status N/A N/A N/A self assertHeadersEqual expected_headers headers N/A N/A N/A self assertEqual None exc_info N/A N/A write_buffer write N/A N/A args N/A start_response N/A response N/A fn args kwargs N/A N/A N/A self assertNotEqual None response N/A %r(*args, **kwargs) != None fn N/A response N/A N/A join response N/A N/A N/A self assertIsInstance response str N/A response %r must be a str N/A response N/A 10 N/A N/A N/A self assertMultiLineEqual expected_content N/A N/A N/A write_buffer getvalue response N/A N/A RewriterTestCase N/A WSGITestCase N/A N/A Base class for test cases that test rewriter functionality. N/A rewriter_middleware N/A staticmethod N/A request_rewriter frontend_rewriter_middleware assert_rewritten_response N/A N/A self expected_status expected_headers expected_body application environ N/A None N/A N/A Tests that a rewritten application produces the expected response.

    This applies the response rewriter chain to application and then tests the
    result.

    Args:
      expected_status: The expected HTTP status returned e.g. '200 OK'.
      expected_headers: A dict, list or wsgiref.headers.Headers representing the
          expected generated HTTP headers e.g. {'Content-type': 'text/plain'}.
      expected_body: The expected content generated e.g. 'Hello World'.
      application: A WSGI application that will be called and have its response
        rewritten.
      environ: Optional environment to pass to the application.
     N/A N/A environ None N/A N/A environ N/A N/A wrapped_application N/A N/A self rewriter_middleware application N/A N/A N/A self assertResponse expected_status expected_headers expected_body wrapped_application environ N/A N/A constant_app N/A N/A status headers body N/A N/A N/A Creates a WSGI application that produces a constant response.

  Args:
    status: A status code and message as a string. (e.g., '200 OK'.)
    headers: A list of tuples containing the response headers.
    body: A string containing the response body.

  Returns:
    A WSGI application, as defined in PEP-333.
   application N/A N/A unused_environ start_response N/A N/A N/A N/A start_response status headers N/A N/A body N/A N/A application N/A