Don't use reserved word file as var name
Return deferred in _process_stopped, upload_logfile
Fix test_process_stopped_success

trials will check whether twisted's reactor still has open connections
or outstanding calls left after a unit test and error when it does. To
make it wait for them to close, the test needs to return a deferred.
Fix test_process_stopped_failure
Call treq.put with persistent=False

This is a workaround to make some of the unit tests work again. All
network connections need to be closed when a unit test ends, but under
normal conditions, treq will use keep-alive on HTTP-Connections, keeping
them open even after an HTTP request.

A solution that affects only the tests themselves and not the normal way
the code works would be preferred to this one.
Remove test_leaf_without_trailing_slash

After the latest changes to allow single object access under leaf
resources, this test is no longer pertinent.
Use factory if provided in BaseHTTPTestCase

This allows test cases inheriting from this to specify a factory for
instancing the resource to be tested.  This is useful for cases where
just calling <class>() with no arguments is not going to work, because
the class's constructor needs an argument.  The Assign resource is an
example for that.
Provide and use a factory for Assign resources
Add attempt to tasks in test job data
Don't test the jobtype instance if not there

Assign will create the jobtype instance asynchronously in a deferred
after the actual HTTP request was served and answered, so the jobytpe
will generally not be instanced yet at this point.