Example #1
0
def createProductInstance(productTemplateId,
                          accountTemplateId,
                          definition,
                          contentType="text/xml"):
    testData = t_utils.getTestData(definition,
                                   substitutions={
                                       "{templateId}": productTemplateId,
                                       "{accountTemplateId}": accountTemplateId
                                   })
    return o_utils.createInstance("product", testData, contentType=contentType)
Example #2
0
def createSubscriptionInstance(subscriptionTemplateId, userTemplateId,
                               productId, userId, shortCode, definition):
    testData = t_utils.getTestData(definition,
                                   substitutions={
                                       "{templateId}": subscriptionTemplateId,
                                       "{userTemplateId}": userTemplateId,
                                       "{productId}": productId,
                                       "{userId}": userId,
                                       "{shortCode}": shortCode
                                   })
    return o_utils.createInstance("subscription", testData)
def loadTemplateFromFile(definitionFile):
    testTemplate = t_utils.getTestData(definitionFile)
    template = eval(loadTemplate(testTemplate))
    templateId = template["id"]
    return templateId
Example #4
0
    testData = t_utils.getTestData(definition,
                                   substitutions={
                                       "{templateId}": productTemplateId,
                                       "{accountTemplateId}": accountTemplateId
                                   })
    return o_utils.createInstance("product", testData, contentType=contentType)


def createUserInstance(userTemplateId,
                       accountId,
                       definition,
                       case=None,
                       contentType="text/xml"):
    testData = t_utils.getTestData(definition,
                                   substitutions={
                                       "{templateId}": userTemplateId,
                                       "{accountId}": accountId
                                   },
                                   case=case)
    return o_utils.createInstance("user", testData, contentType=contentType)


def createSubscriptionInstance(subscriptionTemplateId, userTemplateId,
                               productId, userId, shortCode, definition):
    testData = t_utils.getTestData(definition,
                                   substitutions={
                                       "{templateId}": subscriptionTemplateId,
                                       "{userTemplateId}": userTemplateId,
                                       "{productId}": productId,
                                       "{userId}": userId,
                                       "{shortCode}": shortCode
                                   })
Example #5
0
def queryInstance(type, definition, substitutions = {}, case=0):
    testData = t_utils.getTestData(definition, substitutions = substitutions, case=case)
    print testData
    return o_utils.makeQuery(type, testData)            
Example #6
0
def loadTemplateFromFile(definitionFile):
    testTemplate = t_utils.getTestData(definitionFile)
    template = eval(loadTemplate(testTemplate))
    templateId = template["id"]
    return templateId
Example #7
0
def updateUser(accountId, definition, case=0, contentType="text/xml"):
    testData = t_utils.getTestData(definition, substitutions = {}, case=case)
    return o_utils.applyDelta("user/"+accountId, testData, contentType=contentType)            
Example #8
0
def setStatus(type, objectId, status, definition, case=0):
    testData = t_utils.getTestData(definition, substitutions = {"{status}":status}, case=case)
    return o_utils.applyDelta(type+"/"+objectId, testData)            
Example #9
0
def setAccountMainUser(accountId, userId, definition, case=0, contentType="text/xml"):
    testData = t_utils.getTestData(definition, substitutions = {"{userId}":userId}, case=case)
    return o_utils.applyDelta("account/"+accountId, testData, contentType=contentType)            
Example #10
0
def createAccountInstance(accountTemplateId, userTemplateId, productId, subProductId1, subProductId2, userId, shortCode, definition, case=0, contentType="text/xml"):
    testData = t_utils.getTestData(definition, substitutions = {"{templateId}":accountTemplateId,"{userTemplateId}":userTemplateId,"{productId}":productId,"{eCntProductId}":subProductId1,"{eCKProductId}":subProductId2,"{userId}":userId,"{shortCode}":shortCode}, case=case)
    #print testData
    return o_utils.createInstance("account", testData, contentType=contentType)            
Example #11
0
def createSubscriptionInstance(subscriptionTemplateId, userTemplateId, productId, userId, shortCode, definition):
    testData = t_utils.getTestData(definition, substitutions = {"{templateId}":subscriptionTemplateId,"{userTemplateId}":userTemplateId,"{productId}":productId,"{userId}":userId,"{shortCode}":shortCode})
    return o_utils.createInstance("subscription", testData)            
Example #12
0
def createUserInstance(userTemplateId, accountId, definition, case=None, contentType="text/xml"):
    testData = t_utils.getTestData(definition, substitutions = {"{templateId}":userTemplateId, "{accountId}": accountId}, case=case)
    return o_utils.createInstance("user", testData, contentType=contentType)            
Example #13
0
def createProductInstance(productTemplateId, accountTemplateId, definition, contentType="text/xml"):
    testData = t_utils.getTestData(definition, substitutions = {"{templateId}":productTemplateId, "{accountTemplateId}":accountTemplateId})
    return o_utils.createInstance("product", testData, contentType=contentType)