l.s.s.t.p.SalesforceXMLRPCTestTransport(Transport) : class documentation

Part of lp.services.salesforce.tests.proxy View In Hierarchy

An XML-RPC test transport for the Salesforce proxy.

This transport contains a small amount of sample data and intercepts requests that would normally be sent via XML-RPC but instead directly provides responses based on the sample data. This transport does not simulate network errors or timeouts.

Method __init__ Undocumented
Method getServerStatus Get the server status. If it responds it is healthy.
Method getUnredeemedVouchers Return the list of unredeemed vouchers for a given id.
Method getAllVouchers Return the complete list of vouchers for a given id.
Method getVoucher Return the voucher.
Method redeemVoucher Redeem the voucher.
Method updateProjectName Set the project name for the given project id.
Method grantVoucher Grant a new voucher to the user.
Method request Call the corresponding XML-RPC method.
Method _createVoucher Create a new voucher with the given term and owner.
Method _findVoucher Find a voucher by id.
def __init__(self):
Undocumented
def _createVoucher(self, owner_oid, term_months):
Create a new voucher with the given term and owner.
def _findVoucher(self, voucher_id):
Find a voucher by id.
@force_fault
def getServerStatus(self):
Get the server status. If it responds it is healthy.

Included here for completeness though it is never called by Launchpad.

@force_fault
def getUnredeemedVouchers(self, lp_openid):
Return the list of unredeemed vouchers for a given id.

The returned value is a list of dictionaries, each having a 'voucher' and 'status' keys.

@force_fault
def getAllVouchers(self, lp_openid):
Return the complete list of vouchers for a given id.

The returned value is a list of dictionaries, each having a 'voucher', 'status', and 'project_id' keys.

@force_fault
def getVoucher(self, voucher_id):
Return the voucher.
@force_fault
def redeemVoucher(self, voucher_id, lp_openid, lp_project_id, lp_project_name):
Redeem the voucher.
Parametersvoucher_idstring representing the unique voucher id.
lp_openidstring representing the Launchpad user's OpenID.
lp_project_idLaunchpad project id
lp_project_nameLaunchpad project name
ReturnsBoolean representing the success or failure of the operation.
@force_fault
def updateProjectName(self, lp_project_id, new_name):
Set the project name for the given project id.

Returns the number of vouchers that were updated.

@force_fault
def grantVoucher(self, admin_openid, approver_openid, recipient_openid, recipient_name, recipient_preferred_email, term_months):
Grant a new voucher to the user.
def request(self, host, handler, request, verbose=None):
Call the corresponding XML-RPC method.

The method name and arguments are extracted from request. The method on this class with the same name as the XML-RPC method is called, with the extracted arguments passed on to it.

API Documentation for Launchpad, generated by pydoctor at 2022-06-16 00:00:12.