Unit testing task queues in AppEngine
Posted
by
Swizec Teller
on Stack Overflow
See other posts from Stack Overflow
or by Swizec Teller
Published on 2011-02-07T22:44:21Z
Indexed on
2011/02/07
23:25 UTC
Read the original article
Hit count: 177
For a very long time now I've been using task queues on AppEngine to schedule tasks, just the way I'm supposed to.
But what I've always been wondering is how does one write tests for that? Until now I've simply made tests to make sure an error doesn't occur on the API that queues a task and then wrote the more proper tests for the API executing the task.
However lately I've started feeling a bit unsatisfied by this and I'm searching for a way to actually test that the correct task has been added to the correct queue. Hopefully this can be done better than simply by deploying the code and hoping for the best.
I'm using django-nonrel, if that has any bearing on the answer.
To recap: How can a unit test be written to confirm tasks have been queued?
© Stack Overflow or respective owner