def nickkey(self, nick): """ Maps a nick to it's rfc-compliant lowercase form. """ if self.server_settings.get("CASEMAPPING", "ascii") == "rfc1459": return util.rfc_nickkey(nick) else: return nick.lower()
def test_rfc_nickkey_length(s): """ Test that length is maintained """ assert len(util.rfc_nickkey(s)) == len(s)
def test_rfc_nickkey_normal(s): """ Test that rfc_nickkey is the normal form of a string """ normal = util.rfc_nickkey(s) assert normal == util.rfc_nickkey(normal)