Module Assign NameStore Str Import alias Import alias Import alias Import alias Import alias ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Pass decorator_list ClassDef bases NameLoad body Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore NameLoad Assign NameStore Str Assign NameStore Str Assign NameStore Str FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Assign AttributeStore NameLoad attr BoolOpOr NameLoad ListLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign NameStore Call NameLoad NameLoad NameLoad NameLoad NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr TupleLoad Call AttributeLoad NameLoad attr NameLoad decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Expr Call NameLoad NameLoad If CompareIs AttributeLoad NameLoad attr NameLoad body Assign AttributeStore NameLoad attr NameLoad For NameStore AttributeLoad NameLoad attr body If Call NameLoad SubscriptLoad NameLoad Index Num NameLoad body Return SubscriptLoad NameLoad Index Num orelse Assign AttributeStore AttributeLoad NameLoad attr attr AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr NameLoad Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call NameLoad NameLoad Expr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad Call AttributeLoad NameLoad attr Return SubscriptLoad SubscriptLoad AttributeLoad NameLoad attr Index Num Index Num Raise Call NameLoad BinOpMod Str TupleLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr decorator_list Assign NameStore NameLoad FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad Str Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call NameLoad Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad Str Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad If Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body If Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad NameLoad body Expr Str If CompareIs NameLoad NameLoad body Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr NameLoad Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If CompareIsNot AttributeLoad NameLoad attr NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If CompareIs NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr orelse Expr Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMod Str TupleLoad AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore BinOpMod Str TupleLoad AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AugAssignAdd NameStore Str Assign NameStore Num For NameStore AttributeLoad NameLoad attr body AugAssignAdd NameStore BinOpMod Str TupleLoad NameLoad AttributeLoad SubscriptLoad NameLoad Index Num attr Call NameLoad AttributeLoad SubscriptLoad NameLoad Index Num attr AugAssignAdd NameStore Num Return NameLoad decorator_list decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str If BoolOpAnd CompareIsNot AttributeLoad AttributeLoad NameLoad attr attr NameLoad CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad orelse If CompareNotEq AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad orelse If CompareNotEq AttributeLoad NameLoad attr AttributeLoad NameLoad attr body Return NameLoad orelse If BoolOpOr CompareIn Str AttributeLoad AttributeLoad NameLoad attr attr CompareIn Str AttributeLoad AttributeLoad NameLoad attr attr body If CompareNotIn Str AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad orelse If CompareNotIn Str AttributeLoad AttributeLoad NameLoad attr attr body Return NameLoad orelse If CompareNotEq SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Str body Return NameLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str If BoolOpAnd NameLoad AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Str body Assign AttributeStore NameLoad attr ListLoad Expr Call AttributeLoad NameLoad attr Dict Str Str orelse Assign AttributeStore NameLoad attr ListLoad Return NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return NameLoad decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam defaults body Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr keyword Num keyword Str keyword NameLoad If CompareIs NameLoad NameLoad body Assign AttributeStore NameLoad attr Dict orelse For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore AttributeLoad NameLoad attr Index NameLoad Call NameLoad NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Str BinOpMod Str TupleLoad AttributeLoad NameLoad attr Call NameLoad AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str Call AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str AttributeLoad NameLoad attr Assign SubscriptStore AttributeLoad NameLoad attr Index Str NameLoad For NameStore NameLoad body If Call NameLoad NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr NameLoad orelse If Call NameLoad NameLoad Str body Expr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Num Return NameLoad decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Expr Call AttributeLoad NameLoad attr NameLoad NameLoad NameLoad NameLoad Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign AttributeStore NameLoad attr Call AttributeLoad AttributeLoad NameLoad attr attr keyword NameLoad keyword NameLoad keyword NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad Return AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases AttributeLoad AttributeLoad NameLoad attr attr body FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad body Assign AttributeStore NameLoad attr BoolOpOr NameLoad Dict If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body Assign AttributeStore NameLoad attr NameLoad If CompareIsNot NameLoad NameLoad body If Call NameLoad NameLoad Str body Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr orelse Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return AttributeLoad NameLoad attr decorator_list decorator_list
N/A N/A __author__ j.s@google.com (Jeff Scudder) N/A StringIO N/A pickle N/A os.path N/A tempfile N/A atom.http_core Error N/A Exception N/A N/A N/A NoRecordingFound N/A Error N/A N/A N/A MockHttpClient N/A object N/A N/A debug None N/A real_client None N/A last_request_was_live False N/A cache_name_prefix gdata_live_test N/A cache_case_name N/A cache_test_name __init__ N/A N/A self recordings real_client N/A None None N/A N/A N/A self _recordings N/A recordings N/A N/A N/A real_client None N/A N/A N/A self real_client real_client N/A add_response N/A N/A self http_request status reason headers body N/A None None N/A N/A response N/A MockHttpResponse status reason headers body N/A N/A N/A N/A self _recordings append N/A N/A N/A http_request _copy response N/A N/A AddResponse add_response request N/A N/A self http_request N/A N/A N/A Provide a recorded response, or record a response for replay.

    If the real_client is set, the request will be made using the
    real_client, and the response from the server will be recorded.
    If the real_client is None (the default), this method will examine
    the recordings and find the first which matches.
     N/A request N/A N/A http_request _copy N/A N/A _scrub_request request N/A N/A N/A self real_client None N/A N/A N/A self last_request_was_live False N/A recording N/A self _recordings N/A N/A N/A _match_request N/A recording N/A 0 request N/A N/A N/A recording N/A 1 N/A N/A N/A N/A self real_client debug N/A self debug N/A N/A self last_request_was_live True N/A response N/A N/A N/A self real_client request http_request N/A scrubbed_response N/A _scrub_response response N/A N/A N/A self add_response request N/A scrubbed_response status N/A scrubbed_response reason N/A dict N/A N/A N/A atom http_core get_headers scrubbed_response N/A N/A scrubbed_response read N/A N/A N/A N/A self _recordings N/A -1 N/A 1 N/A N/A NoRecordingFound N/A No recoding was found for request: %s %s N/A N/A request method N/A str N/A request uri N/A N/A Request request _save_recordings N/A N/A self filename N/A N/A N/A recording_file N/A open N/A N/A N/A os path join N/A N/A tempfile gettempdir filename wb N/A N/A N/A pickle dump N/A self _recordings recording_file N/A N/A N/A recording_file close N/A _load_recordings N/A N/A self filename N/A N/A N/A recording_file N/A open N/A N/A N/A os path join N/A N/A tempfile gettempdir filename rb N/A N/A self _recordings N/A N/A pickle load recording_file N/A N/A N/A recording_file close N/A _delete_recordings N/A N/A self filename N/A N/A N/A full_path N/A N/A N/A os path join N/A N/A tempfile gettempdir filename N/A N/A N/A N/A os path exists full_path N/A N/A N/A N/A os remove full_path N/A _load_or_use_client N/A N/A self filename http_client N/A N/A N/A N/A N/A N/A os path exists N/A N/A N/A os path join N/A N/A tempfile gettempdir filename N/A N/A N/A N/A self _load_recordings filename N/A N/A N/A self real_client http_client N/A use_cached_session N/A N/A self name real_http_client N/A None None N/A N/A Attempts to load recordings from a previous live request.

    If a temp file with the recordings exists, then it is used to fulfill
    requests. If the file does not exist, then a real client is used to
    actually make the desired HTTP requests. Requests and responses are
    recorded and will be written to the desired temprary cache file when
    close_session is called.

    Args:
      name: str (optional) The file name of session file to be used. The file
            is loaded from the temporary directory of this machine. If no name
            is passed in, a default name will be constructed using the
            cache_name_prefix, cache_case_name, and cache_test_name of this
            object.
      real_http_client: atom.http_core.HttpClient the real client to be used
                        if the cached recordings are not found. If the default
                        value is used, this will be an
                        atom.http_core.HttpClient.
     N/A N/A real_http_client None N/A N/A real_http_client N/A N/A N/A atom http_core HttpClient N/A N/A name None N/A N/A N/A self _recordings_cache_name N/A N/A self get_cache_file_name N/A N/A N/A self _recordings_cache_name name N/A N/A N/A self _load_or_use_client N/A self _recordings_cache_name real_http_client N/A close_session N/A N/A self N/A N/A N/A Saves recordings in the temporary file named in use_cached_session. N/A N/A N/A self real_client None N/A N/A N/A N/A self _save_recordings N/A self _recordings_cache_name N/A delete_session N/A N/A self name N/A None N/A N/A Removes recordings from a previous live request. N/A N/A name None N/A N/A N/A N/A self _delete_recordings N/A self _recordings_cache_name N/A N/A N/A N/A self _delete_recordings name N/A get_cache_file_name N/A N/A self N/A N/A N/A N/A %s.%s.%s N/A N/A self cache_name_prefix N/A self cache_case_name N/A self cache_test_name N/A _dump N/A N/A self N/A N/A N/A Provides debug information in a string. N/A output N/A MockHttpClient
  real_client: %s
  cache file name: %s
 N/A N/A self real_client N/A N/A self get_cache_file_name N/A output   recordings:
 N/A i 0 N/A recording N/A self _recordings N/A N/A output N/A     recording %i is for: %s %s
 N/A i N/A N/A recording N/A 0 method N/A str N/A N/A recording N/A 0 uri N/A i 1 N/A output N/A N/A _match_request N/A N/A http_request stored_request N/A N/A N/A Determines whether a request is similar enough to a stored request
     to cause the stored response to be returned. N/A N/A N/A N/A N/A http_request uri host None N/A N/A N/A http_request uri host N/A N/A stored_request uri host N/A N/A False N/A N/A N/A N/A N/A http_request uri path N/A N/A stored_request uri path N/A N/A False N/A N/A N/A N/A http_request method N/A stored_request method N/A N/A False N/A N/A N/A N/A gsessionid N/A N/A http_request uri query N/A gsessionid N/A N/A stored_request uri query N/A N/A N/A gsessionid N/A N/A stored_request uri query N/A N/A False N/A N/A N/A gsessionid N/A N/A http_request uri query N/A N/A False N/A N/A N/A N/A N/A N/A http_request uri query N/A gsessionid N/A N/A N/A stored_request uri query N/A gsessionid N/A N/A False N/A True N/A _scrub_request N/A N/A http_request N/A N/A N/A  Removes email address and password from a client login request.

  Since the mock server saves the request and response in plantext, sensitive
  information like the password should be removed before saving the
  recordings. At the moment only requests sent to a ClientLogin url are
  scrubbed.
   N/A N/A http_request N/A http_request uri N/A N/A http_request uri path N/A N/A N/A N/A http_request uri path endswith ClientLogin N/A N/A N/A http_request _body_parts N/A N/A N/A N/A http_request add_form_inputs N/A form_data client login request has been scrubbed N/A N/A N/A http_request _body_parts N/A N/A http_request N/A _scrub_response N/A N/A http_response N/A N/A N/A http_response N/A EchoHttpClient N/A object N/A N/A Sends the request data back in the response.

  Used to check the formatting of the request as it was sent. Always responds
  with a 200 OK, and some information from the HTTP request is returned in
  special Echo-X headers in the response. The following headers are added
  in the response:
  'Echo-Host': The host name and port number to which the HTTP connection is
               made. If no port was passed in, the header will contain
               host:None.
  'Echo-Uri': The path portion of the URL being requested. /example?x=1&y=2
  'Echo-Scheme': The beginning of the URL, usually 'http' or 'https'
  'Echo-Method': The HTTP method being used, 'GET', 'POST', 'PUT', etc.
   request N/A N/A self http_request N/A N/A N/A N/A N/A self _http_request N/A http_request uri N/A http_request method N/A http_request headers N/A http_request _body_parts N/A _http_request N/A N/A self uri method headers body_parts N/A None None N/A N/A body N/A N/A StringIO StringIO N/A response N/A N/A N/A atom http_core HttpResponse status 200 reason OK body body N/A N/A headers None N/A N/A N/A response _headers N/A N/A N/A N/A header value N/A N/A headers iteritems N/A N/A N/A N/A response _headers N/A header N/A str value N/A N/A N/A response _headers N/A Echo-Host N/A %s:%s N/A N/A uri host N/A str N/A uri port N/A N/A N/A response _headers N/A Echo-Uri N/A N/A uri _get_relative_path N/A N/A N/A response _headers N/A Echo-Scheme N/A uri scheme N/A N/A N/A response _headers N/A Echo-Method method N/A part body_parts N/A N/A N/A isinstance part str N/A N/A N/A N/A body write part N/A N/A N/A hasattr part read N/A N/A N/A N/A body write N/A N/A part read N/A N/A N/A body seek 0 N/A response N/A N/A SettableHttpClient N/A object N/A N/A An HTTP Client which responds with the data given in set_response. __init__ N/A N/A self status reason body headers N/A N/A N/A Configures the response for the server.

    See set_response for details on the arguments to the constructor.
     N/A N/A N/A self set_response status reason body headers N/A N/A self last_request None N/A set_response N/A N/A self status reason body headers N/A N/A N/A Determines the response which will be sent for each request.

    Args:
      status: An int for the HTTP status code, example: 200, 404, etc.
      reason: String for the HTTP reason, example: OK, NOT FOUND, etc.
      body: The body of the HTTP response as a string or a file-like
            object (something with a read method).
      headers: dict of strings containing the HTTP headers in the response.
     N/A N/A self response N/A N/A N/A atom http_core HttpResponse status status reason reason body body N/A N/A N/A self response _headers N/A N/A headers copy N/A request N/A N/A self http_request N/A N/A N/A N/A self last_request http_request N/A N/A self response N/A N/A MockHttpResponse N/A N/A N/A atom http_core HttpResponse N/A __init__ N/A N/A self status reason headers body N/A None None None None N/A N/A N/A self _headers N/A headers N/A N/A N/A status None N/A N/A N/A self status status N/A N/A reason None N/A N/A N/A self reason reason N/A N/A body None N/A N/A N/A hasattr body read N/A N/A N/A self _body N/A N/A body read N/A N/A N/A self _body body N/A read N/A N/A self N/A N/A N/A N/A self _body N/A N/A