Esempio n. 1
0
 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()
Esempio n. 2
0
def test_rfc_nickkey_length(s):
    """ Test that length is maintained """
    assert len(util.rfc_nickkey(s)) == len(s)
Esempio n. 3
0
 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()
Esempio n. 4
0
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)