

def test_async_run_cancel(self):
    job = self.mock.Mock(return_value=None)
    t = self.service.getTask(TestDBusSessionTask)
    ft = ft.asyncRun(job)
    ft.cancel()
    self.assertFalse(job.called)
    self.assertTrue(ft.cancelled())

dataset/ETHPy150Open facebook/sparts/tests/tasks/test_dbus.py TestDBus.test_async_run_cancel/VarMisuse@36/46 `t`->`ft`