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

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

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
Overrides: object.__init__

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