コード例 #1
0
ファイル: test_bot.py プロジェクト: azuline/chitanda
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()
コード例 #2
0
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()