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.
 
 
 

38 lines
1.5 KiB

import unittest
import utils.tdata_tool as t
import basic.program
import os
class MyTestCase(unittest.TestCase):
def runTest(self):
self.test_tdata()
def xtest_tdata(self):
job = basic.program.Job("unit")
args = {"application": "TEST", "application": "ENV01", "modus": "unit", "loglevel": "debug",
"tool": "job_tool", "tdtyp": "csv", "tdsrc": "implement", "tdname": "firstunit",
"modus": "unit"}
job.par.setParameterArgs(args)
filename = str(job.conf.confs["paths"]["testdata"]) + "/" + getattr(job.par, "tdsrc") + "/" + getattr(job.par, "tdname") + ".csv"
tdata = t.readCsv(job.m, filename, None)
self.assertEqual(len(tdata["testa1"]), 3)
setattr(job.par, "tdtyp", "dir")
setattr(job.par, "tdsrc", "TST001")
tdata = t.getTestdata()
self.assertEqual(("steps" in tdata), True)
def test_getCsvSpec(self):
job = basic.program.Job("unit")
tdata = {}
args = {"application": "TEST", "application": "ENV01", "modus": "unit", "loglevel": "debug",
"tdtyp": "csv", "tdsrc": "TC0001", "tdname": "testspec",
"modus": "unit"}
job.par.setParameterArgs(args)
filename = os.path.join(job.conf.confs["paths"]["testdata"], getattr(job.par, "tdsrc"), getattr(job.par, "tdname") + ".csv")
tdata = t.getCsvSpec(job.m, filename, "data")
print("111")
print(tdata)
if __name__ == '__main__':
unittest.main()