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.

68 lines
2.3 KiB

2 years ago
import unittest
import os
import inspect
import utils.path_tool
import basic.message
import basic.program
import basic.constants as B
import test.constants
import test.testtools
import utils.path_const as P
import utils.git_tool
HOME_PATH = test.constants.HOME_PATH
OS_SYSTEM = test.constants.OS_SYSTEM
# here you can select single testfunction for developping the tests
TEST_FUNCTIONS = ["test_01run", "test_02status", "test_03log"]
#TEST_FUNCTIONS = [ "test_01status"]
verbose = False
class MyTestCase(unittest.TestCase):
mymsg = "--------------------------------------------------------------"
def test_01run(self):
global mymsg
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getJob()
result = utils.git_tool.runGit(job, B.ATTR_PATH_PROGRAM, "git status")
2 years ago
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest)
def test_02status(self):
global mymsg
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getJob()
result = utils.git_tool.gitStatus(job, B.ATTR_PATH_PROGRAM)
2 years ago
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest)
def test_03log(self):
global mymsg
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getJob()
result = utils.git_tool.gitLog(job, B.ATTR_PATH_COMPS)
self.assertGreaterEqual(10, len(result))
result = utils.git_tool.gitLog(job, B.ATTR_PATH_COMPS, cnt=1)
self.assertEqual(1, len(result))
apppath = utils.config_tool.getConfigPath(job, P.KEY_BASIC, B.SUBJECT_APPS, "")
repopath = apppath[len(job.conf.confs[B.SUBJECT_PATH][B.ATTR_PATH_COMPS])+1:]
result = utils.git_tool.gitLog(job, B.ATTR_PATH_COMPS, repopath, 1)
self.assertEqual(1, len(result))
2 years ago
MyTestCase.mymsg += "\n----- "+actfunction+" : "+str(cnttest)
def test_zzz(self):
if verbose: print(MyTestCase.mymsg)
if __name__ == '__main__':
verbose = True
unittest.main()