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