pyircbot/tests/test_common.py

12 lines
432 B
Python
Raw Normal View History

2018-01-16 17:04:15 -08:00
from pyircbot import common
def test_parse_line():
assert common.parse_irc_line(":chuck!~chuck@foobar PRIVMSG #jesusandhacking :asdf") == \
('PRIVMSG', ['#jesusandhacking'], 'chuck!~chuck@foobar', "asdf")
def test_parse_notrailing():
assert common.parse_irc_line(":chuck!~chuck@foobar MODE #jesusandhacking -o asciibot") == \
('MODE', ['#jesusandhacking', '-o', 'asciibot'], 'chuck!~chuck@foobar', None)