示例#1
0
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
示例#2
0
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
示例#3
0
文件: dn.py 项目: zpytela/freeipa
 def x500_text(self):
     return dn2str(reversed(self.rdns))
示例#4
0
文件: dn.py 项目: zpytela/freeipa
 def __str__(self):
     return dn2str([self.to_openldap()])
示例#5
0
文件: dn.py 项目: zpytela/freeipa
 def ldap_text(self):
     return dn2str(self.rdns)