|
|
@ -2,7 +2,18 @@ import unittest |
|
|
|
import os |
|
|
|
import inspect |
|
|
|
import shutil |
|
|
|
|
|
|
|
print("start import 1") |
|
|
|
#import model.entity |
|
|
|
print("start import 2") |
|
|
|
#import model.environment |
|
|
|
print("start import 3") |
|
|
|
#import model.application |
|
|
|
print("start import 4") |
|
|
|
#import model.component |
|
|
|
print("start import 5") |
|
|
|
import model.testcase |
|
|
|
import model.testsuite |
|
|
|
import model.factory |
|
|
|
import tools.path_tool |
|
|
|
import tools.job_tool |
|
|
|
import basic.program |
|
|
@ -15,8 +26,10 @@ import tools.file_tool |
|
|
|
|
|
|
|
HOME_PATH = test.constants.HOME_PATH |
|
|
|
PYTHON_CMD = "python" |
|
|
|
TEST_FUNCTIONS = ["test_00init", "test_30startActJob"] |
|
|
|
TEST_FUNCTIONS = ["test_00init"] |
|
|
|
TEST_FUNCTIONS = ["test_00init", |
|
|
|
"test_11selectApplication", "test_12selectComponent", "test_13selectEnvironment" |
|
|
|
"test_30startActJob"] |
|
|
|
TEST_FUNCTIONS = ["test_11selectApplication", "test_12selectComponent", "test_13selectEnvironment"] |
|
|
|
|
|
|
|
PROGRAM_NAME = "clean_workspace" |
|
|
|
|
|
|
@ -46,6 +59,18 @@ class MyTestCase(unittest.TestCase): |
|
|
|
self.assertIn("configpath", job.conf) |
|
|
|
self.assertIn("paths", job.conf) |
|
|
|
|
|
|
|
def test_11selectApplication(self): |
|
|
|
global mymsg |
|
|
|
actfunction = str(inspect.currentframe().f_code.co_name) |
|
|
|
cnttest = 0 |
|
|
|
if actfunction not in TEST_FUNCTIONS: |
|
|
|
return |
|
|
|
# simple job instantiate - without parameter and only simple messaging |
|
|
|
job = basic.program.Job(PROGRAM_NAME) |
|
|
|
res = tools.job_tool.select_application(job, {}, "TESTPROJ") |
|
|
|
self.assertIsInstance(res, list) |
|
|
|
print(str(res)) |
|
|
|
|
|
|
|
def test_30startActJob(self): |
|
|
|
global mymsg |
|
|
|
actfunction = str(inspect.currentframe().f_code.co_name) |
|
|
@ -58,5 +83,31 @@ class MyTestCase(unittest.TestCase): |
|
|
|
args = tools.file_tool.read_file_dict(job, path, job.m) |
|
|
|
tools.job_tool.start_child_process(job, args) |
|
|
|
|
|
|
|
def test_12selectComponent(self): |
|
|
|
global mymsg |
|
|
|
actfunction = str(inspect.currentframe().f_code.co_name) |
|
|
|
cnttest = 0 |
|
|
|
if actfunction not in TEST_FUNCTIONS: |
|
|
|
return |
|
|
|
# simple job instantiate - without parameter and only simple messaging |
|
|
|
job = basic.program.Job(PROGRAM_NAME) |
|
|
|
# res = tools.job_tool.select_components(job, {}, "TESTPROJ", "") |
|
|
|
res = model.factory.getComponent(job).read_unique_names(job, "TESTPROJ", "", "", {}) |
|
|
|
self.assertIsInstance(res, list) |
|
|
|
print(str(res)) |
|
|
|
|
|
|
|
def test_13selectEnvironment(self): |
|
|
|
global mymsg |
|
|
|
actfunction = str(inspect.currentframe().f_code.co_name) |
|
|
|
cnttest = 0 |
|
|
|
if actfunction not in TEST_FUNCTIONS: |
|
|
|
return |
|
|
|
# simple job instantiate - without parameter and only simple messaging |
|
|
|
job = basic.program.Job(PROGRAM_NAME) |
|
|
|
#res = tools.job_tool.select_components(job, {}, "TESTPROJ", "") |
|
|
|
res = model.environment.Environment(job).read_unique_names(job, "TESTPROJ", "", "", {}) |
|
|
|
self.assertIsInstance(res, list) |
|
|
|
print(str(res)) |
|
|
|
|
|
|
|
if __name__ == '__main__': |
|
|
|
unittest.main() |
|
|
|