def test_bottery_import_msghandlers(mock_import_module): # TODO: export settings to a fixture from bottery.conf import settings settings.configure(ROOT_MSGCONF='another_handlers') expected_return = ['handlers'] mock_import_module.return_value.msghandlers = expected_return bottery = Bottery() assert bottery.import_msghandlers() == expected_return assert mock_import_module.call_args == (('another_handlers', ), )
def run(bot_module, port): bot = Bottery() try: bot.run(server_port=port) except KeyboardInterrupt: bot.stop()
def get_wsgi_application(): bot = Bottery() bot.configure() return bot.server
def test_already_defined_properties(attribute): bot = Bottery() setattr(bot, '_{}'.format(attribute), attribute) assert getattr(bot, attribute) == attribute
def bot(): bot = Bottery() yield bot bot.stop()
def test_already_defined_properties(settings, attribute): bot = Bottery(settings_module=settings) setattr(bot, '_{}'.format(attribute), attribute) assert getattr(bot, attribute) == attribute
def bot(settings): bot = Bottery(settings_module=settings) yield bot bot.stop()