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()))
Test that Cooperators refuse new tasks when they have been stopped.
dataset/ETHPy150Open twisted/twisted/twisted/test/test_cooperator.py/CooperatorTests.testStoppedRejectsNewTasks