parameters: (self, operation, url, data=None, headers=None)
docstring: Returns a matching MockResponse from the recordings.
      
      If the real_client is set, the request will be passed along and the 
      server's response will be added to the recordings and also returned. 
  
      If there is no match, a NoRecordingFound error will be raised.
docstring_summary: Returns a matching MockResponse from the recordings.
      
      If the real_client is set, the request will be passed along and the 
      server's response will be added to the recordings and also returned.
docstring_tokens: Returns a matching MockResponse from the recordings . If the real_client is set the request will be passed along and the server s response will be added to the recordings and also returned .
function: def request(self, operation, url, data=None, headers=None):
      """Returns a matching MockResponse from the recordings.
      
      If the real_client is set, the request will be passed along and the 
      server's response will be added to the recordings and also returned. 
  
      If there is no match, a NoRecordingFound error will be raised.
      """
      if self.real_client is None:
        if isinstance(url, (str, unicode)):
          url = atom.url.parse_url(url)
        for recording in self.recordings:
          if recording[0].operation == operation and recording[0].url == url:
            return recording[1]
        raise NoRecordingFound('No recodings found for %s %s' % (
            operation, url))
      else:
        # There is a real HTTP client, so make the request, and record the 
        # response.
        response = self.real_client.request(operation, url, data=data, 
            headers=headers)
        # TODO: copy the headers
        stored_response = MockResponse(body=response, status=response.status,
            reason=response.reason)
        self.add_response(stored_response, operation, url, data=data, 
            headers=headers)
        return stored_response
function_tokens: def request ( self , operation , url , data = None , headers = None ) : if self . real_client is None : if isinstance ( url , ( str , unicode ) ) : url = atom . url . parse_url ( url ) for recording in self . recordings : if recording [ 0 ] . operation == operation and recording [ 0 ] . url == url : return recording [ 1 ] raise NoRecordingFound ( 'No recodings found for %s %s' % ( operation , url ) ) else : # There is a real HTTP client, so make the request, and record the  # response. response = self . real_client . request ( operation , url , data = data , headers = headers ) # TODO: copy the headers stored_response = MockResponse ( body = response , status = response . status , reason = response . reason ) self . add_response ( stored_response , operation , url , data = data , headers = headers ) return stored_response