tests.test_irc_create_bot   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 17
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 1

1 Function

Rating   Name   Duplication   Size   Complexity  
A test_create_bot() 0 19 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
        commands=[],
24
        channels=set(),
25
    )
26
27
    bot = create_bot(config)
28
29
    assert type(bot) == expected_type
30