Beispiel #1
0
    def testParallelReturnsAllResults(self, taskqueue, ndb):
        queue.parallel(
            task(Ok, 'ONE'), task(Ok, 'TWO')
        ).then(handler).run()
        consume(taskqueue)

        assert [["ONE", "TWO"]] == messages
Beispiel #2
0
    def testParallel(self, taskqueue, ndb):
        queue.parallel(
            task(P, 'ONE'), task(P, 'TWO'), task(P, 'THREE')
        ).run()

        assert count_tasks(taskqueue) == 3
        consume(taskqueue)

        assert 'ONE TWO THREE'.split() == messages
Beispiel #3
0
    def testAbortParallel(self, taskqueue, fastndb):
        queue.parallel(
            task(P, 'ONE'), task(T), task(P, 'TWO')
        ).then(task(C)).run()

        consume(taskqueue)
        assert "ONE TWO".split() == messages

        assert [] == queue._Counter.query().fetch()
Beispiel #4
0
    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
Beispiel #5
0
    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()
Beispiel #6
0
    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'))