Example #1
0
def test_parsemsg():
    s = b":foo!bar@localhost NICK foobar"
    source, command, args = parsemsg(s)
    assert source == (u"foo", u"bar", u"localhost")
    assert command == "NICK"
    assert args == [u"foobar"]

    s = b""
    source, command, args = parsemsg(s)
    assert source == (None, None, None)
    assert command is None
    assert args == []
Example #2
0
def test_parsemsg():
    s = b(":foo!bar@localhost NICK foobar")
    source, command, args = parsemsg(s)
    assert source == (u("foo"), u("bar"), u("localhost"))
    assert command == "NICK"
    assert args == [u("foobar")]

    s = b("")
    source, command, args = parsemsg(s)
    assert source == (None, None, None)
    assert command is None
    assert args == []
Example #3
0
def test_parsemsg():
    s = b(":foo!bar@localhost NICK foobar")
    source, command, args = parsemsg(s)
    assert source == (u("foo"), u("bar"), u("localhost"))
    assert command == "NICK"
    assert args == [u("foobar")]

    s = b("")
    source, command, args = parsemsg(s)
    assert source == (None, None, None)
    assert command is None
    assert args == []