def CMDstart_bot(args): """Starts the swarming bot.""" logging_utils.prepare_logging('swarming_bot.log') logging_utils.set_console_level(logging.DEBUG) logging.info('importing bot_main: %s, %s', THIS_FILE, zip_package.generate_version()) import bot_main result = bot_main.main(args) logging.info('bot_main exit code: %d', result) return result
def CMDstart_bot(args): """Starts the swarming bot.""" logging_utils.prepare_logging('swarming_bot.log') logging_utils.set_console_level(logging.DEBUG) logging.info( 'importing bot_main: %s, %s', THIS_FILE, zip_package.generate_version()) import bot_main result = bot_main.main(args) logging.info('bot_main exit code: %d', result) return result
def test_main(self): def check(x): self.assertEqual(logging.WARNING, x) self.mock(logging_utils, 'set_console_level', check) def run_bot(error): self.assertEqual(None, error) return 0 self.mock(bot_main, 'run_bot', run_bot) self.assertEqual(0, bot_main.main([]))
def test_main(self): def check(x): self.assertEqual(logging.WARNING, x) self.mock(logging_utils, 'set_console_level', check) def run_bot(error): self.assertEqual(None, error) return 0 self.mock(bot_main, 'run_bot', run_bot) class Singleton(object): # pylint: disable=no-self-argument def acquire(self2): return True def release(self2): self.fail() self.mock(bot_main, 'SINGLETON', Singleton()) self.assertEqual(0, bot_main.main([]))
def test_main(self): def check(x): self.assertEqual(logging.WARNING, x) self.mock(logging_utils, 'set_console_level', check) def run_bot(error): self.assertEqual(None, error) return 0 self.mock(bot_main, '_run_bot', run_bot) class Singleton(object): # pylint: disable=no-self-argument def acquire(self2): return True def release(self2): self.fail() self.mock(bot_main, 'SINGLETON', Singleton()) self.assertEqual(0, bot_main.main([]))