summaryrefslogtreecommitdiff
path: root/crocoite/test_irc.py
blob: 268c604b073668e546933f47d7e70a1bfbacf07a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import pytest
from .irc import ArgparseBot

def test_mode_parse ():
    assert ArgparseBot.parseMode ('+a') == [('+', 'a')]
    assert ArgparseBot.parseMode ('+ab') == [('+', 'a'), ('+', 'b')]
    assert ArgparseBot.parseMode ('+a+b') == [('+', 'a'), ('+', 'b')]
    assert ArgparseBot.parseMode ('-a') == [('-', 'a')]
    assert ArgparseBot.parseMode ('-ab') == [('-', 'a'), ('-', 'b')]
    assert ArgparseBot.parseMode ('-a-b') == [('-', 'a'), ('-', 'b')]
    assert ArgparseBot.parseMode ('+a-b') == [('+', 'a'), ('-', 'b')]
    assert ArgparseBot.parseMode ('-a+b') == [('-', 'a'), ('+', 'b')]
    assert ArgparseBot.parseMode ('-ab+cd') == [('-', 'a'), ('-', 'b'), ('+', 'c'), ('+', 'd')]