def check_b(self, trunk, task): task.wait() self.assertEqual(task.status, Task.STATUS_SUCCESS, 'task_b should have succeeded.') self.assertEqual(task.result, 5, 'task_b result should be 5') self.check_f(task.subtasks.get(details__result=5)) self.check_g(task.subtasks.get(details__result='g')) self.check_h(task.subtasks.get(details__result='h'))
def check_a(self, trunk, task): task.wait() assert task.status == Task.STATUS_INCOMPLETE, 'task_a should be incomplete.' # self.assertEqual(task.result, 'e', 'task_a result should be "e"') self.check_c(task.subtasks.get(details__result='c')) self.check_d(task.subtasks.get(details__error__isnull=False)) self.check_e(task.subtasks.get(details__result='e'))
def check_h(self, task): task.wait() assert task.result == 'h', 'task_h result should be "h"'
def check_g(self, task): task.wait() assert task.result == 'g', 'task_g result should be "g"'
def check_f(self, task): task.wait() self.assertEqual(task.result, 5, 'task_f result should be 5')
def check_e(self, task): task.wait() assert task.result == 'e', 'task_e result should be "e"'
def check_d(self, task): task.wait() assert task.result == None, 'task_d result should be "None"' self.assertEqual(task.error, 'Task D, should fail.', 'task_d should have an error')
def check_c(self, task): task.wait() assert task.result == 'c', 'task_c result should be "c"'
def check_trunk(self, task): task.wait() self.assertEqual(task.status, Task.STATUS_INCOMPLETE, 'trunk should be incomplete.') self.check_a(task, task.subtasks.get(signature__func_name='cq.management.commands.cq_load_test.task_a')) self.check_b(task, task.subtasks.get(signature__func_name='cq.management.commands.cq_load_test.task_b'))