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.

42 lines
2.0 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 test_path(self):
job = Job("unit")
#t = utils.path_tool.PathTool()
3 years ago
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")
3 years ago
print(r)
r = utils.path_tool.getKeyValue("job.conf.results")
3 years ago
print(r)
self.assertEqual(r, "/home/ulrich/6_Projekte/Programme/holtz/test/target")
r = utils.path_tool.composePath("tcbase", None)
3 years ago
#r = t.replaceNoPython("{job.conf.archiv}/{job.par.release}/{job.par.testcase}/{job.par.tctime}", "{job.conf.archiv}", "/home/basic/6_Projekte/Programme/pythonProject/test/lauf")
3 years ago
print(r)
args = { "application" : "TEST" , "application" : "ENV01", "modus" : "unit", "loglevel" : "debug",
"tool" : "job_tool", "tsdir": os.path.join(HOME_PATH, "test","lauf","V0.1","startjob","2021-08-21_18-ß2-01")}
3 years ago
job = Job.resetInstance("unit")
job.par.setParameterArgs(args)
3 years ago
# r = t.extractPath("tsbase" , "/home/basic/6_Projekte/Programme/pythonProject/test/lauf/V0.1/startjob/2021-08-21_18-ß2-01")
r = utils.path_tool.extractPattern("tsbase" )
3 years ago
print(r)
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","lauf","V0.1","startjob_2021-08-21_10-02-01"))
3 years ago
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()