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 == []
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 == []