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