|
|
@ -15,7 +15,7 @@ PYTHON_CMD = "python" |
|
|
|
TEST_FUNCTIONS = ["test_10getEntityNames", "test_11getEntities", "test_12getEntity", |
|
|
|
"test_13writeEntity" #, "test_14insertEntity" |
|
|
|
] |
|
|
|
#TEST_FUNCTIONS = ["test_10getEntityNames", "test_12getEntity"] |
|
|
|
TEST_FUNCTIONS = ["test_14insertEntity"] |
|
|
|
PROGRAM_NAME = "clean_workspace" |
|
|
|
|
|
|
|
class MyTestCase(unittest.TestCase): |
|
|
@ -62,7 +62,7 @@ class MyTestCase(unittest.TestCase): |
|
|
|
job = test.testtools.getJob() |
|
|
|
project = model.project.Project(job) |
|
|
|
name = "TESTPROJ" |
|
|
|
actproject = project.read_entity(job, name) |
|
|
|
actproject = project.read_entity(job, name=name) |
|
|
|
self.assertEqual(getattr(actproject, model.project.FIELD_NAME), name) |
|
|
|
self.assertRaises(Exception, project.read_entity, job, "xyzxyz") |
|
|
|
# |
|
|
@ -87,22 +87,10 @@ class MyTestCase(unittest.TestCase): |
|
|
|
if actfunction not in TEST_FUNCTIONS: |
|
|
|
return |
|
|
|
job = test.testtools.getJob() |
|
|
|
username = "hans_xyz" |
|
|
|
project = model.project.Project(job) |
|
|
|
entityNames = collectInnerList(project.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
#self.assertNotIn(username, entityNames) |
|
|
|
project.username = username |
|
|
|
project.name = "Hans" |
|
|
|
project.famname = "im Glueck" |
|
|
|
project.project = "TESTPROJ" |
|
|
|
#project.insert_entity(job, username, table="project") |
|
|
|
entityNames = collectInnerList(project.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
self.assertIn(username, entityNames) |
|
|
|
actUser = project.select_entity(job, username) |
|
|
|
self.assertEqual(getattr(actUser, model.project.FIELD_USERNAME), username) |
|
|
|
actUser.delete_entity(job, username, "project") |
|
|
|
entityNames = collectInnerList(project.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
self.assertNotIn(username, entityNames) |
|
|
|
name = "TESTPROJ" |
|
|
|
actproject = project.read_entity(job, name=name) |
|
|
|
actproject.insert_entity(job) |
|
|
|
|
|
|
|
def collectInnerList(inList): |
|
|
|
outList = [] |
|
|
|