Removed test noise and formatted for pep8
This commit is contained in:
@@ -87,7 +87,6 @@ class JobTest(unittest.TestCase):
|
||||
cls.job_names = []
|
||||
|
||||
def test_job_get(self):
|
||||
print '\nTesting job_get...'
|
||||
expected = self.job_names[0]
|
||||
actual = db_api.job_get('', self.job_ids[0]).name
|
||||
|
||||
@@ -96,7 +95,6 @@ class JobTest(unittest.TestCase):
|
||||
self.assertRaises(exception.NotFound, db_api.job_get, '', 9001)
|
||||
|
||||
def test_job_update(self):
|
||||
print '\nTesting job_update...'
|
||||
db_api.job_update('', 1, dict(owner='OwnerTest', state=states.CLAIMED))
|
||||
job = db_api.job_get('', 1)
|
||||
|
||||
@@ -114,7 +112,6 @@ class JobTest(unittest.TestCase):
|
||||
dict(owner='OwnerTest', state=states.CLAIMED))
|
||||
|
||||
def test_job_add_workflow(self):
|
||||
print '\nTesting job_add_workflow...'
|
||||
db_api.workflow_create('', u'workflow_10')
|
||||
self.wf_ids.append(10)
|
||||
self.wf_names.append(u'workflow_10')
|
||||
@@ -134,7 +131,6 @@ class JobTest(unittest.TestCase):
|
||||
1, u'workflow_9001')
|
||||
|
||||
def test_job_get_owner(self):
|
||||
print '\nTesting job_get_owner...'
|
||||
actual = db_api.job_get_owner('', 1)
|
||||
|
||||
self.assertIsNone(actual)
|
||||
@@ -142,7 +138,6 @@ class JobTest(unittest.TestCase):
|
||||
self.assertRaises(exception.NotFound, db_api.job_get_owner, '', 9001)
|
||||
|
||||
def test_job_get_state(self):
|
||||
print '\nTesting job_get_state...'
|
||||
expected = states.UNCLAIMED
|
||||
actual = db_api.job_get_state('', 1)
|
||||
|
||||
@@ -151,7 +146,6 @@ class JobTest(unittest.TestCase):
|
||||
self.assertRaises(exception.NotFound, db_api.job_get_state, '', 9001)
|
||||
|
||||
def test_job_get_logbook(self):
|
||||
print '\nTesting job_get_logbook...'
|
||||
expected = self.lb_names[0]
|
||||
actual = db_api.job_get_logbook('', 1).name
|
||||
|
||||
@@ -160,7 +154,6 @@ class JobTest(unittest.TestCase):
|
||||
self.assertRaises(exception.NotFound, db_api.job_get_logbook, '', 9001)
|
||||
|
||||
def test_job_create(self):
|
||||
print '\nTesting job_create...'
|
||||
id = 1
|
||||
while (self.job_ids.count(id) > 0):
|
||||
id = id + 1
|
||||
@@ -172,7 +165,6 @@ class JobTest(unittest.TestCase):
|
||||
self.assertIsNotNone(actual)
|
||||
|
||||
def test_job_destroy(self):
|
||||
print '\nTesting job_destroy...'
|
||||
id = self.job_ids.pop()
|
||||
db_api.job_destroy('', id)
|
||||
self.job_names.pop()
|
||||
@@ -216,7 +208,6 @@ class LogBookTest(unittest.TestCase):
|
||||
cls.lb_names = []
|
||||
|
||||
def test_logbook_get(self):
|
||||
print '\nTesting logbook_get...'
|
||||
expected = self.lb_names[0]
|
||||
actual = db_api.logbook_get('', self.lb_ids[0]).name
|
||||
|
||||
@@ -225,7 +216,6 @@ class LogBookTest(unittest.TestCase):
|
||||
self.assertRaises(exception.NotFound, db_api.logbook_get, '', 9001)
|
||||
|
||||
def test_logbook_get_by_name(self):
|
||||
print '\nTesting logbook_get_by_name...'
|
||||
expected = [self.lb_ids[0]]
|
||||
actual = []
|
||||
for logbook in db_api.logbook_get_by_name('', self.lb_names[0]):
|
||||
@@ -237,7 +227,6 @@ class LogBookTest(unittest.TestCase):
|
||||
u'logbook_9001')
|
||||
|
||||
def test_logbook_create(self):
|
||||
print '\nTesting logbook_create...'
|
||||
id = 1
|
||||
while (self.lb_ids.count(id) > 0):
|
||||
id = id + 1
|
||||
@@ -250,7 +239,6 @@ class LogBookTest(unittest.TestCase):
|
||||
self.assertIsNotNone(actual)
|
||||
|
||||
def test_logbook_get_workflows(self):
|
||||
print '\nTesting logbook_get_workflows...'
|
||||
expected = self.wf_ids
|
||||
actual = []
|
||||
wfs = db_api.logbook_get_workflows('', self.lb_ids[0])
|
||||
@@ -264,7 +252,6 @@ class LogBookTest(unittest.TestCase):
|
||||
'', 9001)
|
||||
|
||||
def test_logbook_add_workflow(self):
|
||||
print '\nTesting logbook_add_workflow...'
|
||||
db_api.workflow_create('', u'workflow_10')
|
||||
self.wf_ids.append(10)
|
||||
self.wf_names.append(u'workflow_10')
|
||||
@@ -284,7 +271,6 @@ class LogBookTest(unittest.TestCase):
|
||||
1, u'workflow_9001')
|
||||
|
||||
def test_logbook_destroy(self):
|
||||
print '\nTesting logbook_destroy...'
|
||||
id = self.lb_ids.pop()
|
||||
db_api.logbook_destroy('', id)
|
||||
self.lb_names.pop()
|
||||
@@ -329,7 +315,6 @@ class WorkflowTest(unittest.TestCase):
|
||||
cls.wf_names = []
|
||||
|
||||
def test_workflow_get(self):
|
||||
print '\nTesting workflow_get...'
|
||||
expected = self.wf_ids[0]
|
||||
actual = db_api.workflow_get('', self.wf_names[0]).id
|
||||
|
||||
@@ -339,7 +324,6 @@ class WorkflowTest(unittest.TestCase):
|
||||
u'workflow_9001')
|
||||
|
||||
def test_workflow_get_all(self):
|
||||
print '\nTesting workflow_get_all...'
|
||||
expected = self.wf_ids
|
||||
actual = []
|
||||
temp = db_api.workflow_get_all('')
|
||||
@@ -350,7 +334,6 @@ class WorkflowTest(unittest.TestCase):
|
||||
self.assertEquals(expected, actual)
|
||||
|
||||
def test_workflow_get_names(self):
|
||||
print '\nTesting workflow_get_names...'
|
||||
expected = []
|
||||
for name in self.wf_names:
|
||||
expected.append(name)
|
||||
@@ -361,7 +344,6 @@ class WorkflowTest(unittest.TestCase):
|
||||
self.assertEquals(expected, actual)
|
||||
|
||||
def test_workflow_get_tasks(self):
|
||||
print '\nTesting workflow_get_tasks...'
|
||||
expected = [self.tsk_names[0], self.tsk_names[9]]
|
||||
actual = []
|
||||
temp = db_api.workflow_get_tasks('', u'workflow_1')
|
||||
@@ -375,7 +357,6 @@ class WorkflowTest(unittest.TestCase):
|
||||
u'workflow_9001')
|
||||
|
||||
def test_workflow_add_task(self):
|
||||
print '\nTesting workflow_add_task...'
|
||||
tsk_tmp = db_api.task_create('', u'task_10', 1, 10)
|
||||
db_api.workflow_add_task('', u'workflow_1', 10)
|
||||
self.tsk_ids.append(10)
|
||||
@@ -392,7 +373,6 @@ class WorkflowTest(unittest.TestCase):
|
||||
u'workflow_1', 9001)
|
||||
|
||||
def test_workflow_create(self):
|
||||
print '\nTesting workflow_create...'
|
||||
id = 0
|
||||
while (self.wf_ids.count(id) > 0):
|
||||
id = id + 1
|
||||
@@ -404,7 +384,6 @@ class WorkflowTest(unittest.TestCase):
|
||||
u'workflow_{}'.format(id)))
|
||||
|
||||
def test_workflow_destroy(self):
|
||||
print '\nTesting workflow_destroy...'
|
||||
name = self.wf_names.pop()
|
||||
db_api.workflow_destroy('', name)
|
||||
self.wf_ids.pop()
|
||||
@@ -436,7 +415,6 @@ class TaskTest(unittest.TestCase):
|
||||
cls.tsk_names = []
|
||||
|
||||
def test_task_get(self):
|
||||
print '\nTesting task_get...'
|
||||
expected = self.tsk_names[0]
|
||||
actual = db_api.task_get('', self.tsk_ids[0])
|
||||
|
||||
@@ -445,7 +423,6 @@ class TaskTest(unittest.TestCase):
|
||||
self.assertRaises(exception.NotFound, db_api.task_get, '', 9001)
|
||||
|
||||
def test_task_create(self):
|
||||
print '\nTesting task_create...'
|
||||
id = 1
|
||||
while (self.tsk_ids.count(id) > 0):
|
||||
id = id + 1
|
||||
@@ -456,7 +433,6 @@ class TaskTest(unittest.TestCase):
|
||||
self.assertIsNotNone(db_api.task_get('', id))
|
||||
|
||||
def test_task_update(self):
|
||||
print '\nTesting task_update...'
|
||||
db_api.task_update('', 1, dict(exception='ExceptionTest',
|
||||
stacktrace='StacktraceTest'))
|
||||
task = db_api.task_get('', 1)
|
||||
@@ -475,7 +451,6 @@ class TaskTest(unittest.TestCase):
|
||||
dict(exception='ExceptionTest', stacktrace='StacktraceTest'))
|
||||
|
||||
def test_task_destroy(self):
|
||||
print '\nTesting task_destroy...'
|
||||
id = self.tsk_ids.pop()
|
||||
db_api.task_destroy('', id)
|
||||
self.tsk_names.pop()
|
||||
|
Reference in New Issue
Block a user