def testAbortInOrder(self, taskqueue, ndb): queue.inorder( task(A), task(T), task(C) ).run() consume(taskqueue) assert ["A"] == messages
def testInOrderReturnsLastResult(self, taskqueue, ndb): queue.inorder( task(Ok, 'ONE'), task(Ok, 'TWO') ).then(handler).run() consume(taskqueue) assert ['TWO'] == messages
def testNestedInOrder(self, taskqueue, ndb): queue.inorder( task(A), queue.inorder(task(P, 'ONE'), task(P, 'TWO')), task(C) ).run() consume(taskqueue) assert 'A ONE TWO C'.split() == messages
def testInOrder(self, taskqueue, ndb): queue.inorder( task(A), task(B), task(C) ).run() assert count_tasks(taskqueue) == 1 consume(taskqueue) assert ['A', 'B', 'C'] == messages
def testEnsureInOrderExecution(self, taskqueue, ndb): queue.inorder( task(A), task(DEFER), task(B) ).run() consume(taskqueue) assert "A DEFER deferred B".split() == messages
def testReturnAbortToAbort(self, taskqueue, ndb): queue.inorder( task(A), task(RETURN_ABORT), task(B) ).run() consume(taskqueue) assert ["A"] == messages
def testNestedParallel(self, taskqueue, ndb): queue.inorder( task(A), queue.parallel( queue.parallel(task(P, 'ONE'), task(P, 'TWO'), task(P, 'THREE')), task(B)), task(C) ).run() consume(taskqueue) assert "A B ONE TWO THREE C".split() == messages
def testCombined(self, taskqueue, fastndb): queue.inorder( task(A), queue.parallel(task(P, 'ONE'), task(P, 'TWO'), task(P, 'THREE')), task(B) ).run() consume(taskqueue) assert 'A ONE TWO THREE B'.split() == messages assert [] == queue._Counter.query().fetch()
def testEnsureMultipleTaskGetCleanedIfReleaseAfterIsIused( self, taskqueue, fastndb): queue.inorder( task(P, 'ONE') ).enqueue(release_after=1) queue.inorder( task(P, 'TWO') ).enqueue(release_after=1) consume(taskqueue) semaphores = queue.Lock.model.query().fetch() assert len(semaphores) == 0
def testA(self, taskqueue, ndb): A = queue.inorder( task(P) ).enqueue(use_id='A') B = queue.inorder( task(P) ).enqueue(use_id='B') assert count_tasks(taskqueue) == 2 tick(taskqueue) assert count_tasks(taskqueue) == 2 tick(taskqueue) assert count_tasks(taskqueue) == 0 assert 'P P'.split() == messages
def testTaskStr(self): print task(P, message='ONE') print queue.inorder(task(A), task(B)) print queue.parallel(task(A), task(B), task(P, message='ONE'))