import unittest import os from basic.program import Job from basic.componentHandling import ComponentManager import init_testcase import test_executer import test.constants HOME_PATH = test.constants.HOME_PATH PYTHON_CMD = "python" class MyTestCase(unittest.TestCase): def runTest(self): #self.test_parameter() #self.test_components() self.test_run() def xtest_parameter(self): job = Job("unit") args = { "application" : "TEST" , "environment" : "ENV01", "modus" : "unit", "loglevel" : "debug", "tool" : "job_tool", "function": "reset_TData,load_TData" } job.par.setParameterArgs(args) self.assertEqual(job.hascomponente("TestA"), True) self.assertEqual(job.hasTool("TestA"), False) self.assertEqual(job.hasTool("job_tool"), True) self.assertEqual(job.getDebugLevel("file_tool"), 23) self.assertEqual(job.getDebugLevel("job_tool"), 23) self.assertEqual(job.hasFunction("reset_TData"), True) self.assertEqual(job.hasFunction("load_TData"), True) self.assertEqual(job.hasFunction("read_TData"), False) args = { "application" : "TEST" , "environment" : "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")} job.par.setParameterArgs(args) def xtest_components(self): print("# # # # tetsComponents # # # # #") job = Job.resetInstance("unit") args = { "application" : "TEST" , "environment" : "ENV01", "modus" : "unit", "loglevel" : "debug", "tool" : "job_tool"} job.par.setParameterArgs(args) cm = ComponentManager() cm.createComponent("testb", 0, "") cm.createComponent("testa", 1, "") def test_run(self): # os.system("python "+os.path.join(HOME_PATH, "check_environment.py")+" -a TEST -e ENV01") # os.system("python "+os.path.join(HOME_PATH, "init_testsuite.py")+" -a TEST -e ENV01 " # "-ts "+os.path.join(HOME_PATH, "test","lauf","V0.1","implement_2021-08-28_23-50-51")+" -dt csv -ds implement -dn firstunit") #os.system(PYTHON_CMD+" "+os.path.join(HOME_PATH,"init_testcase.py")+" -a TEST -e ENV01 " # "-tc "+os.path.join(HOME_PATH,"test","lauf","V0.1","TC0001","2021-08-28_23-50-51")+" -dt csv -ds implement -dn TC0001") #args = { "application": "TEST", "environment": "ENV01", "modus": "unit", # "tool": "job_tool", "tsdir": os.path.join(HOME_PATH,"test","conf","lauf","V0.1","TC0001_2021-08-28_23-50-51")} #"loglevel": "debug", "tdtyp": "dir", # "tdsrc": "TC0001", "tdname": "xxx", job = Job("unit") args = { "application": "TEST", "environment": "ENV01", "modus": "unit", "tstime": "2022-03-19_12-09-09", "tsdir": '/home/ulrich/6_Projekte/Programme/datest/test/conf/lauf/testlauf/TST001_2022-03-19_12-09-09', "step": 2 } # "usecase": "TST001", "tstime": "2022-03-17_17-28"} job.par.setParameterArgs(args) job.setProgram("test_executer") # init_testcase.start(job) job.startJob() test_executer.start(job) job.stopJob(1) if __name__ == '__main__': unittest.main()