![]() |
App Engine Python SDK
v1.6.9 rev.445
The Python runtime is available as an experimental Preview feature.
|
Public Member Functions | |
def | __init__ |
def | GetPreCallHooks |
def | GetPostCallHooks |
def | ReplaceStub |
def | RegisterStub |
def | GetStub |
def | MakeSyncCall |
def | CancelApiCalls |
Container of APIProxy stubs for more convenient unittesting. Stubs may be either trivial implementations of APIProxy services (e.g. DatastoreFileStub, UserServiceStub) or "real" implementations. For unittests, we may want to mix and match real and trivial implementations of services in order to better focus testing on individual service implementations. To achieve this, we allow the client to attach stubs to service names, as well as define a default stub to be used if no specific matching stub is identified.
def google.appengine.api.apiproxy_stub_map.APIProxyStubMap.__init__ | ( | self, | |
default_stub = None |
|||
) |
Constructor. Args: default_stub: optional stub 'default_stub' will be used whenever no specific matching stub is found.
def google.appengine.api.apiproxy_stub_map.APIProxyStubMap.GetPostCallHooks | ( | self | ) |
Gets a collection for all precall hooks.
def google.appengine.api.apiproxy_stub_map.APIProxyStubMap.GetPreCallHooks | ( | self | ) |
Gets a collection for all precall hooks.
def google.appengine.api.apiproxy_stub_map.APIProxyStubMap.GetStub | ( | self, | |
service | |||
) |
Retrieve the stub registered for the specified service. Args: service: string Returns: stub Returns the stub registered for 'service', and returns the default stub if no such stub is found.
def google.appengine.api.apiproxy_stub_map.APIProxyStubMap.MakeSyncCall | ( | self, | |
service, | |||
call, | |||
request, | |||
response | |||
) |
The APIProxy entry point. Args: service: string representing which service to call call: string representing which function to call request: protocol buffer for the request response: protocol buffer for the response Returns: Response protocol buffer or None. Some implementations may return a response protocol buffer instead of modifying 'response'. Caller must use returned value in such cases. If 'response' is modified then returns None. Raises: apiproxy_errors.Error or a subclass.
def google.appengine.api.apiproxy_stub_map.APIProxyStubMap.RegisterStub | ( | self, | |
service, | |||
stub | |||
) |
Register the provided stub for the specified service. Args: service: string stub: stub
def google.appengine.api.apiproxy_stub_map.APIProxyStubMap.ReplaceStub | ( | self, | |
service, | |||
stub | |||
) |
Replace the existing stub for the specified service with a new one. NOTE: This is a risky operation; external callers should use this with caution. Args: service: string stub: stub