def test_start_webserver_invalid_port(monkeypatch): monkeypatch.setattr("chitanda.bot.config", {"webserver": { "enable": True, "port": "123a" }}) with patch.object(Chitanda, "connect"): with pytest.raises(SystemExit): chitanda = Chitanda() chitanda._start_webserver()
def test_start_webserver_invalid_port(monkeypatch): monkeypatch.setattr('chitanda.bot.config', {'webserver': { 'enable': True, 'port': '123a' }}) with patch.object(Chitanda, 'connect'): with pytest.raises(SystemExit): chitanda = Chitanda() chitanda._start_webserver()