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.

51 lines
1.8 KiB

3 years ago
# This is a sample Python script.
import os
3 years ago
# import jsonpickle # pip install jsonpickle
import yaml # pip install pyyaml
3 years ago
import basic.program as program
3 years ago
import utils.tdata_tool
import basic.componentHandling
import basic.constants as B
3 years ago
import basic.message as message
3 years ago
# Press Umschalt+F10 to execute it or replace it with your code.
# Press Double Shift to search everywhere for classes, files, tool windows, actions, and settings.
3 years ago
PROGRAM_NAME = "init_testcase"
3 years ago
def startPyJob(job):
cm = basic.componentHandling.ComponentManager.getInstance("init")
3 years ago
print("cm "+str(cm))
cm.initComponents()
comps = cm.getComponents(PROGRAM_NAME)
job.m.setMsg("# Components initialized with these relevant components " + str(comps))
3 years ago
testdata = utils.tdata_tool.getTestdata()
for c in comps:
comp = cm.getComponent(c)
comp.m.logInfo("------- "+comp.name+" ----------------------------------------")
if job.hasFunction("reset_TData"):
comp.reset_TData(B.PAR_TESTCASE)
if job.hasFunction("load_TData"):
comp.load_TData(B.PAR_TESTCASE, testdata)
if job.hasFunction("read_TData"):
comp.read_TData("vorher", B.PAR_TESTCASE)
3 years ago
comp.m.logInfo("------- "+comp.name+" ----------------------------------------")
job.m.merge(comp.m)
3 years ago
print(str(comp))
comp.conf["function"][PROGRAM_NAME] = comp.m.topmessage
3 years ago
# Press the green button in the gutter to run the script.
if __name__ == '__main__':
3 years ago
print(PROGRAM_NAME)
x = program.Job(PROGRAM_NAME)
3 years ago
x.startJob()
x.m.logInfo("hier eine LogInfo")
x.m.logDebug("hier eine DbugMeldung")
x.m.logDebug(str(vars(x.par)) + "\n" + str(vars(x.conf)))
if x.m.isRc("fatal"):
x.stopJob()
exit(x.m.rc * (-1) + 3)
startPyJob(x)
3 years ago
x.stopJob()
# See PyCharm help at https://www.jetbrains.com/help/pycharm/