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.
 
 
 

39 lines
1.9 KiB

import unittest
import utils.path_tool
from ulrich.program import Job
class MyTestCase(unittest.TestCase):
def test_path(self):
job = Job("unit")
t = utils.path_tool.PathTool()
args = {"application": "TEST", "environment": "ENV01", "modus": "unit", "loglevel": "debug", "tool": "job_tool",
"modus": "unit", "testcase": "TESTFALL", "release": "V0.1", "tctime": "2021-08-21_12-02-01" }
job.par.setParameterArgs(args)
pt = t.PathConf()
r = t.getKeyValue("job.par.application")
print(r)
r = t.getKeyValue("job.conf.results")
print(r)
self.assertEqual(r, "/home/ulrich/6_Projekte/Programme/pythonProject/test/target")
r = t.composePath("tcbase", None)
#r = t.replaceNoPython("{job.conf.archiv}/{job.par.release}/{job.par.testcase}/{job.par.tctime}", "{job.conf.archiv}", "/home/ulrich/6_Projekte/Programme/pythonProject/test/lauf")
print(r)
args = { "application" : "TEST" , "application" : "ENV01", "modus" : "unit", "loglevel" : "debug",
"tool" : "job_tool", "tsdir": "/home/ulrich/6_Projekte/Programme/pythonProject/test/lauf/V0.1/startjob/2021-08-21_18-ß2-01"}
job = Job.resetInstance("unit")
job.par.setParameterArgs(args)
# r = t.extractPath("tsbase" , "/home/ulrich/6_Projekte/Programme/pythonProject/test/lauf/V0.1/startjob/2021-08-21_18-ß2-01")
r = t.extractPattern("tsbase" )
print(r)
self.assertEqual(r[0][1], "job.conf.archiv")
self.assertEqual(r[3][0], "_")
r = t.extractPath("tsbase" , "/home/ulrich/6_Projekte/Programme/pythonProject/test/lauf/V0.1/startjob_2021-08-21_10-02-01")
print("r " + str(r))
print(vars(job.par))
self.assertEqual(job.par.release, "V0.1")
self.assertEqual(job.par.usecase, "startjob")
self.assertEqual(job.par.tltime, "2021-08-21_10-02-01")
if __name__ == '__main__':
unittest.main()