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