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.

58 lines
1.8 KiB

"""
unit-test for the topic step-execution in step_tool
"""
import unittest
import os
import inspect
import basic.program
import basic.constants as B
import tools.job_const as J
import test.constants as T
import test.testtools
import tools.step_tool
HOME_PATH = T.HOME_PATH
PYTHON_CMD = "python"
#TEST_FUNCTIONS = [ "test_smokeTestcase"]
TEST_FUNCTIONS = ["test_10getNextID"]
PROGRAM_NAME = "unit_tester"
class MyTestCase(unittest.TestCase):
mymsg = "--------------------------------------------------------------"
def test_10getNextID(self):
global mymsg
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getTestJob()
# start-ids,
setattr(job.par, B.PAR_GRAN, B.SUBJECT_TESTCASE)
sid = tools.step_tool.getNextStepID(job, 0, "")
self.assertEqual(J.STEP_INIT_TC, sid)
sid = tools.step_tool.getNextStepID(job, 0, J.STEP_INIT_TC)
self.assertEqual(J.STEP_EXEC_TC1, sid)
self.assertRaises(Exception, tools.step_tool.getNextStepID, job, 0, J.STEP_INIT_TP)
setattr(job.par, B.PAR_GRAN, B.SUBJECT_TESTSUITE)
sid = tools.step_tool.getNextStepID(job, 0, "")
self.assertEqual(J.STEP_INIT_TS, sid)
sid = tools.step_tool.getNextStepID(job, 0, J.STEP_INIT_TS)
self.assertEqual(J.STEP_INIT_TC, sid)
sid = tools.step_tool.getNextStepID(job, 0, J.STEP_INIT_TC)
self.assertEqual(J.STEP_EXEC_TS1, sid)
setattr(job.par, B.PAR_GRAN, B.SUBJECT_TESTPLAN)
sid = tools.step_tool.getNextStepID(job, 0, "")
self.assertEqual(J.STEP_INIT_TP, sid)
sid = tools.step_tool.getNextStepID(job, 0, J.STEP_INIT_TC)
self.assertEqual(J.STEP_EXEC_TS1, sid)
if __name__ == '__main__':
unittest.main()