|
@ -17,10 +17,11 @@ import test.constants as T |
|
|
import test.testtools |
|
|
import test.testtools |
|
|
import tools.path_const as P |
|
|
import tools.path_const as P |
|
|
import basic.constants as B |
|
|
import basic.constants as B |
|
|
|
|
|
import tools.data_const as D |
|
|
|
|
|
|
|
|
TEST_FUNCTIONS = ["test_01getConfigPath", "test_02mergeAttributes", "test_03getAttributes", |
|
|
TEST_FUNCTIONS = ["test_01getConfigPath", "test_02mergeAttributes", "test_03getAttributes", |
|
|
"test_20getPlainName"] |
|
|
"test_20getPlainName"] |
|
|
TEST_FUNCTIONS = ["test_01getConfigPath"] |
|
|
#TEST_FUNCTIONS = ["test_01getConfigPath"] |
|
|
verbose = False |
|
|
verbose = False |
|
|
|
|
|
|
|
|
class MyTestCase(unittest.TestCase): |
|
|
class MyTestCase(unittest.TestCase): |
|
@ -56,10 +57,8 @@ class MyTestCase(unittest.TestCase): |
|
|
cnttest += 1 |
|
|
cnttest += 1 |
|
|
r = tools.config_tool.select_config_path(job, P.KEY_TESTSUITE, "TST001") |
|
|
r = tools.config_tool.select_config_path(job, P.KEY_TESTSUITE, "TST001") |
|
|
self.assertIn(os.path.join(job.conf[B.TOPIC_PATH][P.ATTR_PATH_TDATA], "TESTPROJ", B.SUBJECT_TESTSUITES, "TST001", "test"), r) |
|
|
self.assertIn(os.path.join(job.conf[B.TOPIC_PATH][P.ATTR_PATH_TDATA], "TESTPROJ", B.SUBJECT_TESTSUITES, "TST001", "test"), r) |
|
|
|
|
|
cnttest += 1 |
|
|
|
|
|
r = tools.config_tool.getConfig(job, P.KEY_TOOL, "path", ttype=D.CSV_SPECTYPE_KEYS) |
|
|
|
|
|
|
|
|
r = tools.config_tool.getConfig(job, P.KEY_TOOL, "path") |
|
|
|
|
|
if verbose: print("pattern " + r["pattern"]["log"]) |
|
|
if verbose: print("pattern " + r["pattern"]["log"]) |
|
|
if verbose: print("pattern " + r["pattern"]["precond"]) |
|
|
if verbose: print("pattern " + r["pattern"]["precond"]) |
|
|
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest) |
|
|
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest) |
|
@ -73,22 +72,22 @@ class MyTestCase(unittest.TestCase): |
|
|
return |
|
|
return |
|
|
job = test.testtools.getJob() |
|
|
job = test.testtools.getJob() |
|
|
componentName = "testcm" |
|
|
componentName = "testcm" |
|
|
confs = tools.config_tool.getConfig(job, "comp", componentName) |
|
|
confs = tools.config_tool.getConfig(job, "comp", componentName, ttype=D.CSV_SPECTYPE_COMP) |
|
|
conns = tools.conn_tool.getConnections(job, componentName) |
|
|
conns = tools.conn_tool.getConnections(job, componentName) |
|
|
self.assertEqual(confs["conf"][B.TOPIC_INST][B.ATTR_INST_CNT], 1) |
|
|
self.assertEqual(confs[B.SUBJECT_COMP][B.TOPIC_INST][B.ATTR_INST_CNT], 1) |
|
|
self.assertEqual(conns[0][B.TOPIC_INST][B.ATTR_INST_CNT], 2) |
|
|
self.assertEqual(conns[0][B.TOPIC_INST][B.ATTR_INST_CNT], 2) |
|
|
self.assertNotIn(B.ATTR_INST_SGL, conns[0][B.TOPIC_INST]) |
|
|
self.assertNotIn(B.ATTR_INST_SGL, conns[0][B.TOPIC_INST]) |
|
|
confs["conf"] = tools.config_tool.mergeConn(job.m, confs["conf"], conns[0]) |
|
|
confs[B.SUBJECT_COMP] = tools.config_tool.mergeConn(job.m, confs[B.SUBJECT_COMP], conns[0]) |
|
|
self.assertEqual(confs["conf"][B.TOPIC_INST][B.ATTR_INST_CNT], 2) |
|
|
self.assertEqual(confs[B.SUBJECT_COMP][B.TOPIC_INST][B.ATTR_INST_CNT], 2) |
|
|
cnttest += 1 # it overwrites |
|
|
cnttest += 1 # it overwrites |
|
|
self.assertEqual(confs["conf"][B.TOPIC_INST][B.ATTR_INST_SGL], "n") |
|
|
self.assertEqual(confs[B.SUBJECT_COMP][B.TOPIC_INST][B.ATTR_INST_SGL], "n") |
|
|
cnttest += 1 # it keep |
|
|
cnttest += 1 # it keep |
|
|
componentName = "testprddb" |
|
|
componentName = "testprddb" |
|
|
confs = tools.config_tool.getConfig(job, "comp", componentName) |
|
|
confs = tools.config_tool.getConfig(job, "comp", componentName, ttype=D.CSV_SPECTYPE_COMP) |
|
|
conns = tools.conn_tool.getConnections(job, componentName) |
|
|
conns = tools.conn_tool.getConnections(job, componentName) |
|
|
self.assertNotIn(B.ATTR_ARTS_TYPE, confs["conf"][B.SUBJECT_ARTIFACTS][B.TOPIC_NODE_DB]) |
|
|
self.assertNotIn(B.ATTR_ARTS_TYPE, confs[B.SUBJECT_COMP][B.SUBJECT_ARTIFACTS][B.TOPIC_NODE_DB]) |
|
|
confs["conf"] = tools.config_tool.mergeConn(job.m, confs["conf"], conns[0]) |
|
|
confs[B.SUBJECT_COMP] = tools.config_tool.mergeConn(job.m, confs[B.SUBJECT_COMP], conns[0]) |
|
|
self.assertIn(B.ATTR_ARTS_TYPE, confs["conf"][B.SUBJECT_ARTIFACTS][B.TOPIC_NODE_DB]) |
|
|
self.assertIn(B.ATTR_ARTS_TYPE, confs[B.SUBJECT_COMP][B.SUBJECT_ARTIFACTS][B.TOPIC_NODE_DB]) |
|
|
cnttest += 1 # new attribute |
|
|
cnttest += 1 # new attribute |
|
|
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest) |
|
|
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest) |
|
|
|
|
|
|
|
|