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