def test_run(self, get): out = WhateverIO() r = result(app=self.app, stdout=out) get.return_value = 'Jerry' r.run('id') self.assertIn('Jerry', out.getvalue()) get.return_value = 'Elaine' r.run('id', task=add.name) self.assertIn('Elaine', out.getvalue())
def test_run(self, get): out = WhateverIO() r = result(app=self.app, stdout=out) get.return_value = "Jerry" r.run("id") self.assertIn("Jerry", out.getvalue()) get.return_value = "Elaine" r.run("id", task=add.name) self.assertIn("Elaine", out.getvalue())
def test_run(self): with patch('celery.result.AsyncResult.get') as get: out = WhateverIO() r = result(app=self.app, stdout=out) get.return_value = 'Jerry' r.run('id') self.assertIn('Jerry', out.getvalue()) get.return_value = 'Elaine' r.run('id', task=self.add.name) self.assertIn('Elaine', out.getvalue()) with patch('celery.result.AsyncResult.traceback') as tb: r.run('id', task=self.add.name, traceback=True) self.assertIn(str(tb), out.getvalue())
def test_run(self): with patch("celery.result.AsyncResult.get") as get: out = WhateverIO() r = result(app=self.app, stdout=out) get.return_value = "Jerry" r.run("id") self.assertIn("Jerry", out.getvalue()) get.return_value = "Elaine" r.run("id", task=self.add.name) self.assertIn("Elaine", out.getvalue()) with patch("celery.result.AsyncResult.traceback") as tb: r.run("id", task=self.add.name, traceback=True) self.assertIn(str(tb), out.getvalue())