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.
 
 
 

32 lines
1.6 KiB

import unittest
import utils.file_tool as t
import utils.path_tool
import basic.program
class MyTestCase(unittest.TestCase):
def test_getFiles(self):
job = basic.program.Job("unit")
args = {"application": "TEST", "application": "ENV01", "modus": "unit", "loglevel": "debug", "tool": "job_tool",
"modus": "unit"}
job.par.setParameterArgs(args)
r = t.getFiles(job.m, job.conf.confs.get("paths").get("program") + "/utils", "file_.*.py", None)
self.assertEqual((len(r) == 1), True)
r = t.getFiles(job.m, job.conf.confs.get("paths").get("program") + "/utils", "file__.*.py", None)
self.assertEqual((len(r) == 0), True)
r = t.getFiles(job.m, job.conf.confs.get("paths").get("program") + "/utils", ".*_tool.py", None)
self.assertEqual((len(r) > 2), True)
r = t.getFilesRec(job.m, job.conf.confs.get("paths").get("program"), ".*?file.*.py")
print (r)
def test_pathTool(self):
job = basic.program.Job("unit")
args = {"application": "TEST", "application": "ENV01", "modus": "unit", "loglevel": "debug", "tool": "job_tool",
"modus": "unit"}
job.par.setParameterArgs(args)
self.assertEqual(utils.path_tool.generatePath("program", "komp", "testA", "CONFIG.yml"),
"/home/basic/6_Projekte/PythonProject/komponents/testA/COFIG.yml")
if __name__ == '__main__':
unittest.main()