def test_load_webserver(_, monkeypatch): monkeypatch.setattr("chitanda.bot.config", {"webserver": {"enable": True}}) with patch.object(Chitanda, "_start_webserver"): with patch.object(Chitanda, "connect"): chitanda = Chitanda() chitanda.start() assert chitanda.webserver is not None
def test_load_webserver(_, monkeypatch): monkeypatch.setattr('chitanda.bot.config', {'webserver': {'enable': True}}) with patch.object(Chitanda, '_start_webserver'): with patch.object(Chitanda, 'connect'): chitanda = Chitanda() chitanda.start() assert chitanda.webserver is not None
def test_dont_load_webserver(_, monkeypatch): monkeypatch.setattr("chitanda.bot.config", {"webserver": { "enable": False }}) with patch.object(Chitanda, "_start_webserver"): with patch.object(Chitanda, "connect"): chitanda = Chitanda() chitanda.start() assert not hasattr(chitanda, "webserver")
def test_dont_load_webserver(_, monkeypatch): monkeypatch.setattr('chitanda.bot.config', {'webserver': { 'enable': False }}) with patch.object(Chitanda, '_start_webserver'): with patch.object(Chitanda, 'connect'): chitanda = Chitanda() chitanda.start() assert not hasattr(chitanda, 'webserver')
def run(): """Run the bot.""" bot = Chitanda() bot.start() asyncio.get_event_loop().run_forever()