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.

91 lines
3.1 KiB

import unittest
import os
import inspect
import shutil
import tools.path_tool
import basic.program
import test.testtools
import basic.constants as B
import test.constants as T
import tools.file_tool
import model.application
HOME_PATH = test.constants.HOME_PATH
PYTHON_CMD = "python"
2 years ago
TEST_FUNCTIONS = ["test_10getEntityNames", "test_12getEntity", "test_11getEntities", "test_10getApplications"]
TEST_FUNCTIONS = ["test_11getEntities"]
PROGRAM_NAME = "clean_workspace"
class MyTestCase(unittest.TestCase):
mymsg = "--------------------------------------------------------------"
def test_10getEntityNames(self):
global mymsg
global jobObject
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getJob()
application = model.application.Application()
entityNames = []
entityNames = application.read_unique_names(job, "", "", "", {})
self.assertEquals(type(entityNames), list)
print("apps "+str(entityNames))
#entityNames = component.select_unique_names(job, "", "", "", {})
#self.assertEquals(type(entityNames), list)
2 years ago
def test_11getEntities(self):
global mymsg
global jobObject
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getJob()
application = model.application.Application()
entityNames = application.get_entities(job, storage=model.entity.STORAGE_FILE)
self.assertEqual(type(entityNames), dict)
#entityNames = environment.get_entities(job, storage=model.entity.STORAGE_DB)
#self.assertEqual(type(entityNames), list)
def test_12getEntity(self):
global mymsg
global jobObject
actfunction = str(inspect.currentframe().f_code.co_name)
cnttest = 0
if actfunction not in TEST_FUNCTIONS:
return
job = test.testtools.getJob()
application = model.application.Application()
name = "TESTAPP"
actproject = application.read_entity(job, name)
self.assertEqual(getattr(actproject, model.application.FIELD_NAME), name)
self.assertRaises(Exception, application.read_entity, job, "xyzxyz")
#
#actproject = component.select_entity(job, name)
#self.assertEqual(getattr(actproject, model.component.FIELD_USERNAME), name)
#self.assertRaises(Exception, component.select_entity, job, ["xyzxyz"])
def test_xx10getApplications(self):
global mymsg
global jobObject
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 = test.testtools.getJob()
print(str(job.__dict__))
jobObject = job
projList = ["TESTPROJ"]
apps = model.application.select_applications(job, projList)
print(str(apps))
if __name__ == '__main__':
unittest.main()