def test_parseprefix(): s = "test!foo@localhost" nick, ident, host = parseprefix(s) assert nick == "test" assert ident == "foo" assert host == "localhost" s = "test" nick, ident, host = parseprefix(s) assert nick == "test" assert ident is None assert host is None