def test_dn2str_special(): dnstring = 'cn=R\\2cW privilege' dnstring2 = 'cn=R\\,W privilege' expected = [[('cn', 'R,W privilege', 1)]] dn = str2dn(dnstring) assert dn == expected assert dn2str(dn) == dnstring2 assert dn_ctypes.str2dn(dnstring) == dn assert dn_ctypes.dn2str(dn) == dnstring2
def test_str2dn2str(dnstring, expected): dn = str2dn(dnstring) assert dn == expected assert dn2str(dn) == dnstring assert dn_ctypes.str2dn(dnstring) == dn assert dn_ctypes.dn2str(dn) == dnstring
def x500_text(self): return dn2str(reversed(self.rdns))
def __str__(self): return dn2str([self.to_openldap()])
def ldap_text(self): return dn2str(self.rdns)