Package ganeti :: Package rapi :: Module testutils :: Class _RapiMock
[hide private]
[frames] | no frames]

Class _RapiMock

source code

Mocking out the RAPI server parts.

Instance Methods [hide private]
 
__init__(self, user_fn, luxi_client, reqauth=False)
Initialize this class.
source code
 
FetchResponse(self, path, method, headers, request_body)
This is a callback method used to fetch a response.
source code
Method Details [hide private]

__init__(self, user_fn, luxi_client, reqauth=False)
(Constructor)

source code 

Initialize this class.

Parameters:
  • user_fn (callable) - Function to authentication username
  • luxi_client - A LUXI client implementation

FetchResponse(self, path, method, headers, request_body)

source code 

This is a callback method used to fetch a response.

This method is called by the FakeCurl.perform method

Parameters:
  • path (string) - Requested path
  • method (string) - HTTP method
  • request_body (string) - Request body
  • headers (mimetools.Message) - Request headers
Returns:
Tuple containing status code, response headers and response body