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.

62 lines
2.3 KiB

3 years ago
#
#
3 years ago
# ----------------------------------------------------------
"""
This program is created for the business-test on the level of unit testing.
On this level there is an intensive test-set up to a carthesian product possible.
3 years ago
The test-specification is written in a yaml-config in the data-directory.
workflow:
1. generate test-cases with all inputs into a csv-file of the spec-yaml
2. run the csv-file and collect all results into a new result-csv-file with all inputs and outputs
3. check the result-csv-file and declare it as a target-results
OR instead 2 and 3 on test-first-strategy:
3. create manually the target-result with your inputs and the target system-outputs
4. run and compare the actual-result with the target-result
5. at the end you get an xls-sheet like your result-csv-file
but additionally with comparsion-result as detailed result and the only counts of passed and failed tests
as minimum-result which can be inserted into management-tools
3 years ago
"""
# Press the green button in the gutter to run the script.
import importlib
import unittest
import test.constants
import os, glob
import io
import sys
import test.constants as T
VERIFY = False
class MyTestLoader(unittest.TestLoader):
def start_testcases(self):
pass
def create_test_suite():
suite = unittest.TestSuite()
for testdir in [T.PROG_PATH, T.COMP_PATH]:
print("testdir "+testdir)
testFileStrings = sorted(glob.glob(os.path.join(testdir, "test", 'test_*.py')))
print("testdir "+str(testFileStrings))
for t in testFileStrings:
print("t "+t)
if not t[len(testdir)+11:len(testdir)+13].isnumeric():
continue
if testdir == T.COMP_PATH:
v = "components.test." + t[len(testdir) + 6:-3]
else:
v = "test."+t[len(testdir)+6:-3]
cmodul = importlib.import_module(v)
class_ = getattr(cmodul, "MyTestCase")
c = class_()
for f in cmodul.TEST_FUNCTIONS:
setattr(c, "verbose", False)
suite.addTest(class_(f))
return suite
3 years ago
if __name__ == '__main__':
print ("start")
loader = unittest.TestLoader()
suite = create_test_suite()
runner = unittest.TextTestRunner(sys.stdout, True, 3, True, True)
runner.run(suite)