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.

55 lines
1.8 KiB

3 years ago
import unittest
import os
import inspect
3 years ago
import utils.config_tool as t
3 years ago
from basic.program import Job
import test.constants
import test.testtools
import utils.path_const as P
3 years ago
HOME_PATH = test.constants.HOME_PATH
TEST_FUNCTIONS = ["test_getConfig"]
VERIFY = False
3 years ago
class MyTestCase(unittest.TestCase):
mymsg = "--------------------------------------------------------------"
def test_getConfig(self):
global mymsg
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getJob()
x = "path"
r = t.getConfigPath(P.KEY_TOOL, x)
self.assertIn(os.path.join(HOME_PATH, P.VAL_UTIL, P.VAL_CONFIG), r)
cnttest += 1
x = "conn"
r = t.getConfigPath(P.KEY_TOOL, x)
self.assertIn(os.path.join(job.conf.getPath(P.ATTR_PATH_ENV)), r)
cnttest += 1
self.assertRaises(Exception, t.getConfigPath, (P.KEY_COMP, "TestX2"))
# self.assertEqual(r, None)
cnttest += 1
r = t.getConfigPath(P.KEY_COMP, "testA2")
self.assertIn(os.path.join(job.conf.getPath(P.ATTR_PATH_PROGRAM), P.VAL_COMPS, "testa2", "CONFIG"), r)
r = t.getConfig(P.KEY_TOOL, "path")
if VERIFY: print("pattern " + r["pattern"]["log"])
if VERIFY: print("pattern " + r["pattern"]["precond"])
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest)
3 years ago
def test_getAttributes(self):
global mymsg
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getJob()
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest)
3 years ago
if __name__ == '__main__':
VERIFY = True
3 years ago
unittest.main()