Data-Test-Executer Framework speziell zum Test von Datenverarbeitungen mit Datengenerierung, Systemvorbereitungen, Einspielungen, ganzheitlicher diversifizierender Vergleich
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

129 lines
5.2 KiB

import model.entity
import basic.constants as B
import basic.Testserver
class Magazin():
__instance = None
__entities = {}
@staticmethod
def getInstance():
if Magazin.__instance == None:
return Magazin()
@staticmethod
def setEntity(name, object):
if name not in Magazin.__entities:
Magazin.__entities[name] = object
return Magazin.__entities[name]
@staticmethod
def getEntity(name):
if name in Magazin.__entities:
return Magazin.__entities[name]
@staticmethod
def hasEntity(name):
if name in Magazin.__entities:
return True
return False
def get_entity_object(job, entityname: str, name: str="", args: dict={}):
if name == "" and len(args) == 0 and Magazin.hasEntity(entityname):
return Magazin.getEntity(entityname)
if entityname in [B.SUBJECT_STEPS, B.SUBJECT_STEP]:
entity = getStep(job, entityname, name, args)
elif entityname in [B.SUBJECT_STORIES, B.SUBJECT_STORY, "storys"]:
entity = getStory(job, entityname, name, args)
elif entityname in [B.SUBJECT_VARIANTS, B.SUBJECT_VARIANT]:
entity = getVariant(job, entityname, name, args)
elif entityname in [B.SUBJECT_DATATABLES, B.SUBJECT_DATATABLE]:
entity = getDatatable(job, entityname, name, args)
elif entityname in [B.SUBJECT_USECASES, B.SUBJECT_USECASE]:
entity = getUsecase(job, entityname, name, args)
elif entityname in [B.SUBJECT_PROJECTS, B.SUBJECT_PROJECT]:
entity = getProject(job, entityname, name, args)
elif entityname in [B.SUBJECT_APPS, B.SUBJECT_APP]:
entity = getApplication(job, entityname, name, args)
elif entityname in [B.SUBJECT_COMPS, B.SUBJECT_COMP]:
entity = getComponent(job, entityname, name, args)
elif entityname in [B.SUBJECT_ARTIFACTS, B.SUBJECT_ARTIFACT]:
entity = getArtifact(job, entityname, name, args)
elif entityname in [B.SUBJECT_TESTCASES, B.SUBJECT_TESTCASE]:
entity = getTestcase(job, entityname, name, args)
elif entityname in [B.SUBJECT_TESTSUITES, B.SUBJECT_TESTSUITE]:
entity = getTestsuite(job, entityname, name, args)
elif entityname in [B.SUBJECT_TESTPLANS, B.SUBJECT_TESTPLAN]:
entity = getTestplan(job, entityname, name, args)
elif entityname in [B.SUBJECT_USERS, B.SUBJECT_USER]:
entity = getUser(job, entityname, name, args)
elif entityname in [B.SUBJECT_REL, B.SUBJECT_RELS]:
entity = getRelease(job, entityname, name, args)
elif entityname in [B.SUBJECT_ENVIRONMENT, B.SUBJECT_ENVIRONMENTS]:
entity = getEnvironment(job, entityname, name, args)
else:
return None
if name == "" and len(args) == 0 and not Magazin.hasEntity(entityname):
return Magazin.setEntity(entityname, entity)
return entity
def getRelease(job=None, entityname: str="" , name: str="", args: dict={}):
import model.prelease
return model.prelease.Release(job, entityname, name, args)
def getEnvironment(job=None, entityname: str="" , name: str="", args: dict={}):
import model.environment
return model.environment.Environment(job, entityname, name, args)
def getArtifact(job=None, entityname: str="" , name: str="", args: dict={}):
import model.artifact
return model.artifact.Artifact(job, entityname, name, args)
def getApplication(job=None, entityname: str="" , name: str="", args: dict={}):
import model.application
return model.application.Application(job, entityname, name, args)
def getProject(job=None, entityname: str="" , name: str="", args: dict={}):
1 year ago
import model.project
return model.project.Project(job, entityname, name, args)
1 year ago
def getComponent(job=None, entityname: str="" , name: str="", args: dict={}):
import model.component
return model.component.Component(job, entityname, name, args)
def getTestplan(job=None, entityname: str="" , name: str="", args: dict={}):
1 year ago
import model.testplan
return model.testplan.Testplan(job, entityname, name, args)
1 year ago
def getTestsuite(job=None, entityname: str="" , name: str="", args: dict={}):
import model.testsuite
return model.testsuite.Testsuite(job, entityname, name, args)
def getTestcase(job=None, entityname: str="" , name: str="", args: dict={}):
import model.testcase
return model.testcase.Testcase(job, entityname, name, args)
def getStep(job=None, entityname: str="" , name: str="", args: dict={}):
import model.step
return model.step.Step(job, entityname, name, args)
def getStory(job=None, entityname: str="" , name: str="", args: dict={}):
import model.story
return model.story.Story(job, entityname, name, args)
def getUsecase(job=None, entityname: str="" , name: str="", args: dict={}):
import model.usecase
return model.usecase.Usecase(job, entityname, name, args)
def getUser(job=None, entityname: str="" , name: str="", args: dict={}):
import model.user
return model.user.User(job, entityname, name, args)
def getVariant(job=None, entityname: str="" , name: str="", args: dict={}):
import model.variant
return model.variant.Variant(job, entityname, name, args)
def getDatatable(job=None, entityname: str="" , name: str="", args: dict={}):
import model.datatable
return model.datatable.Datatable(job, entityname, name, args)