def test_pauseResume(self):
        # first, sanity check
        self.scheduler.pump()
        self.assertEqual(self.work, [1])
        self.scheduler.pump()
        self.assertEqual(self.work, [1, 2])

        # OK, now for real
        self.task.pause()
        self.scheduler.pump()
        self.assertEqual(self.work, [1, 2])
        self.task.resume()
        # Resuming itself shoult not do any work
        self.assertEqual(self.work, [1, 2])
        self.scheduler.pump()
        # But when the scheduler rolls around again...
        self.assertEqual(self.work, [1, 2, 3])
Cooperators should stop running their tasks when they're paused, and
dataset/ETHPy150Open twisted/twisted/twisted/test/test_cooperator.py/RunStateTests.test_pauseResume