|
|
@ -9,7 +9,7 @@ import inspect |
|
|
|
import test.testtools |
|
|
|
import basic.constants as B |
|
|
|
import test.constants as T |
|
|
|
import model.release |
|
|
|
import model.prelease |
|
|
|
import model.entity |
|
|
|
import tools.data_const as D |
|
|
|
|
|
|
@ -33,9 +33,9 @@ class MyTestCase(unittest.TestCase): |
|
|
|
if actfunction not in TEST_FUNCTIONS: |
|
|
|
return |
|
|
|
job = test.testtools.getJob() |
|
|
|
release = model.release.Release(job) |
|
|
|
prelease = model.prelease.Release(job) |
|
|
|
entityNames = [] |
|
|
|
entityNames = release.read_unique_names(job, "", "", "", {}) |
|
|
|
entityNames = prelease.read_unique_names(job, "", "", "", {}) |
|
|
|
self.assertEqual(type(entityNames), list) |
|
|
|
#entityNames = project.select_unique_names(job, "", "", "", {}) |
|
|
|
#self.assertEqual(type(entityNames), list) |
|
|
@ -48,11 +48,11 @@ class MyTestCase(unittest.TestCase): |
|
|
|
if actfunction not in TEST_FUNCTIONS: |
|
|
|
return |
|
|
|
job = test.testtools.getJob() |
|
|
|
release = model.release.Release(job) |
|
|
|
prelease = model.prelease.Release(job) |
|
|
|
entityNames = [] |
|
|
|
entityNames = release.get_entities(job, storage=model.entity.STORAGE_FILE) |
|
|
|
entityNames = prelease.get_entities(job, storage=model.entity.STORAGE_FILE) |
|
|
|
self.assertEqual(type(entityNames), list) |
|
|
|
#entityNames = release.get_entities(job, storage=model.entity.STORAGE_DB) |
|
|
|
#entityNames = prelease.get_entities(job, storage=model.entity.STORAGE_DB) |
|
|
|
#self.assertEqual(type(entityNames), list) |
|
|
|
|
|
|
|
def test_12getEntity(self): |
|
|
@ -63,15 +63,15 @@ class MyTestCase(unittest.TestCase): |
|
|
|
if actfunction not in TEST_FUNCTIONS: |
|
|
|
return |
|
|
|
job = test.testtools.getJob() |
|
|
|
release = model.release.Release(job) |
|
|
|
prelease = model.prelease.Release(job) |
|
|
|
name = "V-1.1.0" |
|
|
|
actrelease = release.read_entity(job, name) |
|
|
|
actrelease = prelease.read_entity(job, name) |
|
|
|
self.assertEqual(getattr(actrelease, D.FIELD_NAME), name) |
|
|
|
self.assertRaises(Exception, release.read_entity, job, "xyzxyz") |
|
|
|
self.assertRaises(Exception, prelease.read_entity, job, "xyzxyz") |
|
|
|
# |
|
|
|
#actrelease = release.select_entity(job, name) |
|
|
|
#self.assertEqual(getattr(actrelease, model.release.FIELD_NAME), name) |
|
|
|
#self.assertRaises(Exception, release.select_entity, job, ["xyzxyz"]) |
|
|
|
#actrelease = prelease.select_entity(job, name) |
|
|
|
#self.assertEqual(getattr(actrelease, model.prelease.FIELD_NAME), name) |
|
|
|
#self.assertRaises(Exception, prelease.select_entity, job, ["xyzxyz"]) |
|
|
|
|
|
|
|
def test_13writeEntity(self): |
|
|
|
global mymsg |
|
|
@ -91,20 +91,20 @@ class MyTestCase(unittest.TestCase): |
|
|
|
return |
|
|
|
job = test.testtools.getJob() |
|
|
|
username = "hans_xyz" |
|
|
|
release = model.release.Release() |
|
|
|
entityNames = collectInnerList(release.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
prelease = model.prelease.Release() |
|
|
|
entityNames = collectInnerList(prelease.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
#self.assertNotIn(username, entityNames) |
|
|
|
release.username = username |
|
|
|
release.name = "Hans" |
|
|
|
release.famname = "im Glueck" |
|
|
|
release.project = "TESTPROJ" |
|
|
|
#release.insert_entity(job, username, table="release") |
|
|
|
entityNames = collectInnerList(release.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
prelease.username = username |
|
|
|
prelease.name = "Hans" |
|
|
|
prelease.famname = "im Glueck" |
|
|
|
prelease.project = "TESTPROJ" |
|
|
|
#prelease.insert_entity(job, username, table="prelease") |
|
|
|
entityNames = collectInnerList(prelease.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
self.assertIn(username, entityNames) |
|
|
|
actUser = release.select_entity(job, username) |
|
|
|
self.assertEqual(getattr(actUser, model.release.FIELD_NAME), username) |
|
|
|
actUser.delete_entity(job, username, "release") |
|
|
|
entityNames = collectInnerList(release.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
actUser = prelease.select_entity(job, username) |
|
|
|
self.assertEqual(getattr(actUser, model.prelease.FIELD_NAME), username) |
|
|
|
actUser.delete_entity(job, username, "prelease") |
|
|
|
entityNames = collectInnerList(prelease.get_unique_names(job, storage=model.entity.STORAGE_DB)) |
|
|
|
self.assertNotIn(username, entityNames) |
|
|
|
|
|
|
|
def collectInnerList(inList): |
|
|
|