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.

45 lines
1.8 KiB

import unittest, os
3 years ago
import utils.path_tool
3 years ago
from basic.program import Job
import test.constants
3 years ago
HOME_PATH = test.constants.HOME_PATH
3 years ago
class MyTestCase(unittest.TestCase):
def runTest(self):
self.test_path()
def test_key(self):
pass
3 years ago
def test_path(self):
job = Job("unit")
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 = utils.path_tool.PathConf()
r = utils.path_tool.getKeyValue("job.par.application")
#print(r)
r = utils.path_tool.getKeyValue("job.conf.results")
#print(r)
3 years ago
self.assertEqual(r, os.path.join(HOME_PATH,"test","target"))
r = utils.path_tool.composePath("tcbase", None)
#print(r)
3 years ago
args = { "application" : "TEST" , "application" : "ENV01", "modus" : "unit", "loglevel" : "debug",
"tool" : "job_tool", "tsdir": os.path.join(HOME_PATH, "test","conf","lauf","V0.1","startjob","2021-08-21_18-ß2-01")}
3 years ago
job = Job.resetInstance("unit")
job.par.setParameterArgs(args)
r = utils.path_tool.extractPattern("tsbase" )
#print(r)
3 years ago
self.assertEqual(r[0][1], "job.conf.archiv")
self.assertEqual(r[3][0], "_")
r = utils.path_tool.extractPath("tsbase" , os.path.join(HOME_PATH, "test","conf","lauf","V0.1","startjob_2021-08-21_10-02-01"))
#print("r " + str(r))
#print(vars(job.par))
3 years ago
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()