|
@ -18,7 +18,7 @@ import utils.path_const as P |
|
|
import basic.constants as B |
|
|
import basic.constants as B |
|
|
|
|
|
|
|
|
TEST_FUNCTIONS = ["test_01getConfig", "test_02mergeAttributes", "test_03getAttributes"] |
|
|
TEST_FUNCTIONS = ["test_01getConfig", "test_02mergeAttributes", "test_03getAttributes"] |
|
|
TEST_FUNCTIONS = ["test_03getAttributes"] |
|
|
#TEST_FUNCTIONS = ["test_03getAttributes"] |
|
|
verbose = False |
|
|
verbose = False |
|
|
|
|
|
|
|
|
class MyTestCase(unittest.TestCase): |
|
|
class MyTestCase(unittest.TestCase): |
|
@ -32,18 +32,18 @@ class MyTestCase(unittest.TestCase): |
|
|
return |
|
|
return |
|
|
job = test.testtools.getJob() |
|
|
job = test.testtools.getJob() |
|
|
x = B.SUBJECT_APPS |
|
|
x = B.SUBJECT_APPS |
|
|
r = utils.config_tool.getConfigPath(x, P.KEY_BASIC) |
|
|
r = utils.config_tool.getConfigPath(job, P.KEY_BASIC, x) |
|
|
self.assertIn(os.path.join(T.COMP_PATH, B.SUBJECT_APPS), r) |
|
|
self.assertIn(os.path.join(T.COMP_PATH, P.VAL_CONFIG, B.SUBJECT_APPS), r) |
|
|
cnttest += 1 |
|
|
cnttest += 1 |
|
|
x = "path" |
|
|
x = "path" |
|
|
r = utils.config_tool.getConfigPath(x, P.KEY_TOOL) |
|
|
r = utils.config_tool.getConfigPath(job, P.KEY_TOOL, x) |
|
|
self.assertIn(os.path.join(T.PROG_PATH, P.VAL_UTIL, P.VAL_CONFIG), r) |
|
|
self.assertIn(os.path.join(T.PROG_PATH, P.VAL_UTIL, P.VAL_CONFIG), r) |
|
|
cnttest += 1 |
|
|
cnttest += 1 |
|
|
x = "conn" |
|
|
x = "conn" |
|
|
r = utils.config_tool.getConfigPath(x, P.KEY_TOOL) |
|
|
r = utils.config_tool.getConfigPath(job, P.KEY_TOOL, x) |
|
|
self.assertIn(os.path.join(job.conf.getPath(P.ATTR_PATH_ENV)), r) |
|
|
self.assertIn(os.path.join(job.conf.getPath(P.ATTR_PATH_ENV)), r) |
|
|
cnttest += 1 |
|
|
cnttest += 1 |
|
|
self.assertRaises(Exception, utils.config_tool.getConfigPath, (P.KEY_COMP, "TestX2")) |
|
|
self.assertRaises(Exception, utils.config_tool.getConfigPath, (job, P.KEY_COMP, "TestX2")) |
|
|
# self.assertEqual(r, None) |
|
|
# self.assertEqual(r, None) |
|
|
cnttest += 1 |
|
|
cnttest += 1 |
|
|
r = utils.config_tool.getConfigPath(job, P.KEY_COMP, "testcrm") |
|
|
r = utils.config_tool.getConfigPath(job, P.KEY_COMP, "testcrm") |
|
@ -98,9 +98,9 @@ class MyTestCase(unittest.TestCase): |
|
|
comp = test.testtools.getComp(job, "testrest") |
|
|
comp = test.testtools.getComp(job, "testrest") |
|
|
path = "file.xmlrest" |
|
|
path = "file.xmlrest" |
|
|
attrList = utils.config_tool.getAttributeList(comp, path, job) |
|
|
attrList = utils.config_tool.getAttributeList(comp, path, job) |
|
|
print(str(comp.conf["conn"])) |
|
|
#print(str(comp.conf["conn"])) |
|
|
print(str(comp.conf[B.SUBJECT_ARTS])) |
|
|
#print(str(comp.conf[B.SUBJECT_ARTS])) |
|
|
print(str(attrList)) |
|
|
#print(str(attrList)) |
|
|
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest) |
|
|
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|