def test_handle_argv(self): x = CeleryCommand(app=self.app) x.execute = Mock() x.handle_argv('celery', []) x.execute.assert_called_with('help', ['help']) x.handle_argv('celery', ['start', 'foo']) x.execute.assert_called_with('start', ['start', 'foo'])
def test_handle_argv(self): x = CeleryCommand(app=self.app) x.execute = Mock() x.handle_argv("celery", []) x.execute.assert_called_with("help", ["help"]) x.handle_argv("celery", ["start", "foo"]) x.execute.assert_called_with("start", ["start", "foo"])
def test_execute_from_commandline(self): x = CeleryCommand(app=self.app) x.handle_argv = Mock() x.handle_argv.return_value = 1 with self.assertRaises(SystemExit): x.execute_from_commandline() x.handle_argv.return_value = True with self.assertRaises(SystemExit): x.execute_from_commandline() x.handle_argv.side_effect = KeyboardInterrupt() with self.assertRaises(SystemExit): x.execute_from_commandline()
def test_execute_from_commandline(self): x = CeleryCommand(app=self.app) x.handle_argv = Mock() x.handle_argv.return_value = 1 with self.assertRaises(SystemExit): x.execute_from_commandline() x.handle_argv.return_value = True with self.assertRaises(SystemExit): x.execute_from_commandline() x.handle_argv.side_effect = KeyboardInterrupt() with self.assertRaises(SystemExit): x.execute_from_commandline() x.respects_app_option = True with self.assertRaises(SystemExit): x.execute_from_commandline(['celery', 'multi']) self.assertFalse(x.respects_app_option) x.respects_app_option = True with self.assertRaises(SystemExit): x.execute_from_commandline(['manage.py', 'celery', 'multi']) self.assertFalse(x.respects_app_option)