Exemplo n.º 1
0
def test_connect_irc(asyncio, irc_listener, monkeypatch):
    monkeypatch.setattr(
        "chitanda.bot.config",
        {
            "webserver": {
                "enable": True
            },
            "irc_servers": {
                "hostname1": {
                    "nickname": 1,
                    "port": 1,
                    "tls": 1,
                    "tls_verify": 1,
                },
                "hostname2": {
                    "nickname": 1,
                    "port": 1,
                    "tls": 1,
                    "tls_verify": 1,
                },
            },
        },
    )

    chitanda = Chitanda()
    chitanda._connect_irc()
    assert "hostname1" in chitanda.irc_listeners
    assert "hostname2" in chitanda.irc_listeners
Exemplo n.º 2
0
def test_connect_irc(asyncio, irc_listener, monkeypatch):
    monkeypatch.setattr(
        'chitanda.bot.config',
        {
            'webserver': {
                'enable': True
            },
            'irc_servers': {
                'hostname1': {
                    'nickname': 1,
                    'port': 1,
                    'tls': 1,
                    'tls_verify': 1,
                },
                'hostname2': {
                    'nickname': 1,
                    'port': 1,
                    'tls': 1,
                    'tls_verify': 1,
                },
            },
        },
    )

    chitanda = Chitanda()
    chitanda._connect_irc()
    assert 'hostname1' in chitanda.irc_listeners
    assert 'hostname2' in chitanda.irc_listeners