'Test that Cooperators refuse new tasks when they have been stopped.'

def testStoppedRejectsNewTasks(self):

    def testwith(stuff):
        c = task.Cooperator()
        c.stop()
        d = c.coiterate(iter(()), stuff)
        d.addCallback(self.cbIter)
        d.addErrback(self.ebIter)
        return d.addCallback((lambda result: self.assertEqual(result, self.RESULT)))
    return testwith(None).addCallback((lambda ign: testwith(defer.Deferred())))
