|
|
@ -3,101 +3,101 @@ import basic.constants as B |
|
|
|
import basic.Testserver |
|
|
|
|
|
|
|
|
|
|
|
def get_entity_object(job, name, args): |
|
|
|
|
|
|
|
if name in [B.SUBJECT_STEPS, B.SUBJECT_STEP]: |
|
|
|
entity = getStep(job) |
|
|
|
elif name in [B.SUBJECT_STORIES, B.SUBJECT_STORY, "storys"]: |
|
|
|
entity = getStory(job) |
|
|
|
elif name in [B.SUBJECT_VARIANTS, B.SUBJECT_VARIANT]: |
|
|
|
entity = getVariant(job) |
|
|
|
elif name in [B.SUBJECT_DATATABLES, B.SUBJECT_DATATABLE]: |
|
|
|
entity = getDatatable(job) |
|
|
|
elif name in [B.SUBJECT_USECASES, B.SUBJECT_USECASE]: |
|
|
|
entity = getUsecase(job) |
|
|
|
elif name in [B.SUBJECT_PROJECTS, B.SUBJECT_PROJECT]: |
|
|
|
entity = getProject(job) |
|
|
|
elif name in [B.SUBJECT_APPS, B.SUBJECT_APP]: |
|
|
|
entity = getApplication(job) |
|
|
|
elif name in [B.SUBJECT_COMPS, B.SUBJECT_COMP]: |
|
|
|
entity = getComponent(job) |
|
|
|
elif name in [B.SUBJECT_ARTIFACTS, B.SUBJECT_ARTIFACT]: |
|
|
|
entity = getEnvironment(job) |
|
|
|
elif name in [B.SUBJECT_TESTCASES, B.SUBJECT_TESTCASE]: |
|
|
|
entity = getTestcase(job) |
|
|
|
elif name in [B.SUBJECT_TESTSUITES, B.SUBJECT_TESTSUITE]: |
|
|
|
entity = getTestsuite(job) |
|
|
|
elif name in [B.SUBJECT_TESTPLANS, B.SUBJECT_TESTPLAN]: |
|
|
|
entity = getTestplan(job) |
|
|
|
elif name in [B.SUBJECT_USERS, B.SUBJECT_USER]: |
|
|
|
entity = getUser(job) |
|
|
|
elif name in [B.SUBJECT_REL, B.SUBJECT_RELS]: |
|
|
|
entity = getRelease(job) |
|
|
|
elif name in [B.SUBJECT_ENVIRONMENT, B.SUBJECT_ENVIRONMENTS]: |
|
|
|
entity = getEnvironment(job) |
|
|
|
def get_entity_object(job, entityname: str, name: str="", args: dict={}): |
|
|
|
|
|
|
|
if entityname in [B.SUBJECT_STEPS, B.SUBJECT_STEP]: |
|
|
|
entity = getStep(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_STORIES, B.SUBJECT_STORY, "storys"]: |
|
|
|
entity = getStory(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_VARIANTS, B.SUBJECT_VARIANT]: |
|
|
|
entity = getVariant(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_DATATABLES, B.SUBJECT_DATATABLE]: |
|
|
|
entity = getDatatable(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_USECASES, B.SUBJECT_USECASE]: |
|
|
|
entity = getUsecase(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_PROJECTS, B.SUBJECT_PROJECT]: |
|
|
|
entity = getProject(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_APPS, B.SUBJECT_APP]: |
|
|
|
entity = getApplication(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_COMPS, B.SUBJECT_COMP]: |
|
|
|
entity = getComponent(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_ARTIFACTS, B.SUBJECT_ARTIFACT]: |
|
|
|
entity = getEnvironment(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_TESTCASES, B.SUBJECT_TESTCASE]: |
|
|
|
entity = getTestcase(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_TESTSUITES, B.SUBJECT_TESTSUITE]: |
|
|
|
entity = getTestsuite(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_TESTPLANS, B.SUBJECT_TESTPLAN]: |
|
|
|
entity = getTestplan(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_USERS, B.SUBJECT_USER]: |
|
|
|
entity = getUser(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_REL, B.SUBJECT_RELS]: |
|
|
|
entity = getRelease(job, name, args) |
|
|
|
elif entityname in [B.SUBJECT_ENVIRONMENT, B.SUBJECT_ENVIRONMENTS]: |
|
|
|
entity = getEnvironment(job, name, args) |
|
|
|
else: |
|
|
|
return None |
|
|
|
entity.setAttributes(job, args, name, entity.getFieldList(), entity.getNodeList(), entity.getSubtableList()) |
|
|
|
#entity.setAttributes(job, args, name, entity.getFieldList(), entity.getNodeList(), entity.getSubtableList()) |
|
|
|
#testserver = basic.Testserver.getInstance(job) |
|
|
|
return entity |
|
|
|
|
|
|
|
def getRelease(job=None, name=""): |
|
|
|
def getRelease(job=None, name: str="", args: dict={}): |
|
|
|
import model.release |
|
|
|
return model.release.Release(job) |
|
|
|
return model.release.Release(job, name, args) |
|
|
|
|
|
|
|
def getEnvironment(job=None, name=""): |
|
|
|
def getEnvironment(job=None, name: str="", args: dict={}): |
|
|
|
import model.environment |
|
|
|
return model.environment.Environment(job) |
|
|
|
return model.environment.Environment(job, name, args) |
|
|
|
|
|
|
|
def getArtifact(job=None, name=""): |
|
|
|
def getArtifact(job=None, name: str="", args: dict={}): |
|
|
|
import model.artifact |
|
|
|
return model.artifact.Artifact(job) |
|
|
|
return model.artifact.Artifact(job, name, args) |
|
|
|
|
|
|
|
def getApplication(job=None, args={}, name=""): |
|
|
|
def getApplication(job=None, name: str="", args: dict={}): |
|
|
|
import model.application |
|
|
|
return model.application.Application(job) |
|
|
|
return model.application.Application(job, name, args) |
|
|
|
|
|
|
|
def getProject(job=None, name=""): |
|
|
|
def getProject(job=None, name: str="", args: dict={}): |
|
|
|
import model.project |
|
|
|
return model.project.Project(job) |
|
|
|
return model.project.Project(job, name, args) |
|
|
|
|
|
|
|
def getComponent(job=None, name=""): |
|
|
|
def getComponent(job=None, name: str="", args: dict={}): |
|
|
|
import model.component |
|
|
|
return model.component.Component(job) |
|
|
|
return model.component.Component(job, name, args) |
|
|
|
|
|
|
|
def getTestplan(job=None, project="", application="", name=""): |
|
|
|
def getTestplan(job=None, name: str="", args: dict={}): |
|
|
|
import model.testplan |
|
|
|
return model.testplan.Testplan(job, project) |
|
|
|
return model.testplan.Testplan(job, name, args) |
|
|
|
|
|
|
|
def getTestsuite(job=None, name="", project="", application=""): |
|
|
|
def getTestsuite(job=None, name: str="", args: dict={}): |
|
|
|
import model.testsuite |
|
|
|
return model.testsuite.Testsuite(job, name) |
|
|
|
return model.testsuite.Testsuite(job, name, args) |
|
|
|
|
|
|
|
def getTestcase(job=None, project="", application="", name=""): |
|
|
|
def getTestcase(job=None, name: str="", args: dict={}): |
|
|
|
import model.testcase |
|
|
|
return model.testcase.Testcase(job, name) |
|
|
|
return model.testcase.Testcase(job, name, args) |
|
|
|
|
|
|
|
def getStep(job=None, project="", name=""): |
|
|
|
def getStep(job=None, name: str="", args: dict={}): |
|
|
|
import model.step |
|
|
|
return model.step.Step(job, project, name) |
|
|
|
return model.step.Step(job, name, args) |
|
|
|
|
|
|
|
def getStory(job=None, project="", name=""): |
|
|
|
def getStory(job=None, name: str="", args: dict={}): |
|
|
|
import model.story |
|
|
|
return model.story.Story(job, name) |
|
|
|
return model.story.Story(job, name, args) |
|
|
|
|
|
|
|
def getUsecase(job=None, project="", name=""): |
|
|
|
def getUsecase(job=None, name: str="", args: dict={}): |
|
|
|
import model.usecase |
|
|
|
return model.usecase.Usecase(job, name) |
|
|
|
return model.usecase.Usecase(job, name, args) |
|
|
|
|
|
|
|
def getUser(job=None, project="", name=""): |
|
|
|
def getUser(job=None, name: str="", args: dict={}): |
|
|
|
import model.user |
|
|
|
return model.user.User(job, name) |
|
|
|
return model.user.User(job, name, args) |
|
|
|
|
|
|
|
def getVariant(job=None, project="", name=""): |
|
|
|
def getVariant(job=None, name: str="", args: dict={}): |
|
|
|
import model.variant |
|
|
|
return model.variant.Variant(job, name) |
|
|
|
return model.variant.Variant(job, name, args) |
|
|
|
|
|
|
|
def getDatatable(job=None, project="", name=""): |
|
|
|
def getDatatable(job=None, name: str="", args: dict={}): |
|
|
|
import model.datatable |
|
|
|
return model.datatable.Datatable(job, project, name) |
|
|
|
return model.datatable.Datatable(job, name, args) |
|
|
|
|
|
|
|