Ejemplo n.º 1
0
Archivo: irc.py Proyecto: kirkeby/flexo
 def parse_line(self, line):
     prefix, command, parameters = parse_message(line)
     return Message(self, prefix, command, parameters)
Ejemplo n.º 2
0
def test_parse_without_trailing():
    assert parse_message(':localhost 001 Welcome.') \
           == ['localhost', '001', ['Welcome.']]
    assert parse_message(':localhost FURRFU abc:def') \
           == ['localhost', 'FURRFU', ['abc:def']]
Ejemplo n.º 3
0
def test_parse_with_trailing():
    assert parse_message(':localhost PRIVMSG #cafeen :!lart Bender') \
           == ['localhost', 'PRIVMSG', ['#cafeen', '!lart Bender']]
    assert parse_message(':localhost KICK #cafeen kirkeby : Uuuuuud!') \
           == ['localhost', 'KICK', ['#cafeen', 'kirkeby', ' Uuuuuud!']]
Ejemplo n.º 4
0
def test_parse_prefixless():
    assert parse_message('PING 42') \
           == [None, 'PING', ['42']]
    assert parse_message('ERROR :Closing connection') \
           == [None, 'ERROR', ['Closing connection']]