def test_async_run_ok(self):
        # expecting async task to bump the magic number passed as it's
        # argument
        magic_value = 0xdeadcafe

        job = self.mock.Mock(return_value=(magic_value + 1))

        t = self.service.getTask(TestDBusSessionTask)
        ft = t.asyncRun(job, magic_value,
                        other=(magic_value - 1))
        mod_value = ft.result()

        self.assertTrue(job.called)
        self.assertEqual(job.call_args[0], (magic_value,))
        self.assertEqual(job.call_args[1], {'other': magic_value - 1})
        self.assertEqual(mod_value, magic_value + 1)
dataset/ETHPy150Open facebook/sparts/tests/tasks/test_dbus.py/TestDBus.test_async_run_ok/original