Passed
Push — main ( fedced...62aa48 )
by Jochen
01:57
created

tests.test_irc_create_bot   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 16
dl 0
loc 29
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_create_bot() 0 18 1
1
"""
2
:Copyright: 2007-2021 Jochen Kupperschmidt
3
:License: MIT, see LICENSE for details.
4
"""
5
6
import pytest
7
8
from syslog2irc.irc import Bot, create_bot, DummyBot, IrcConfig, IrcServer
9
10
11
@pytest.mark.parametrize(
12
    'server, expected_type',
13
    [
14
        (IrcServer('irc.server.test'), Bot),
15
        (None, DummyBot),
16
    ],
17
)
18
def test_create_bot(server, expected_type):
19
    config = IrcConfig(
20
        server=server,
21
        nickname='nick',
22
        realname='Nick',
23
        channels=set(),
24
    )
25
26
    bot = create_bot(config)
27
28
    assert type(bot) == expected_type
29