OPSI.ldaptor.test.test_distinguishedname module¶
Test cases for ldaptor.protocols.ldap.distinguishedname module.
-
class
OPSI.ldaptor.test.test_distinguishedname.
DistinguishedName_Comparison
(methodName='runTest')¶ Bases:
twisted.trial._asynctest.TestCase
-
testGT
()¶
-
-
class
OPSI.ldaptor.test.test_distinguishedname.
DistinguishedName_Init
(methodName='runTest')¶ Bases:
twisted.trial._asynctest.TestCase
-
testDN
()¶
-
testString
()¶
-
-
class
OPSI.ldaptor.test.test_distinguishedname.
LDAPDistinguishedName_DomainName
(methodName='runTest')¶ Bases:
twisted.trial._asynctest.TestCase
-
testInterleaved_SubHostSubExampleCom
()¶
-
testNonDc
()¶
-
testNonTrailingDc
()¶
-
testSimple_ExampleCom
()¶
-
testSimple_HostSubExampleCom
()¶
-
testSimple_SubExampleCom
()¶
-
-
class
OPSI.ldaptor.test.test_distinguishedname.
LDAPDistinguishedName_Escaping
(methodName='runTest')¶ Bases:
OPSI.ldaptor.test.test_distinguishedname.TestCaseWithKnownValues
-
knownValues
= (('', []), ('cn=foo', [[('cn', 'foo')]]), ('cn=\\,bar', [[('cn', ',bar')]]), ('cn=foo\\,bar', [[('cn', 'foo,bar')]]), ('cn=foo\\,', [[('cn', 'foo,')]]), ('cn=\\+bar', [[('cn', '+bar')]]), ('cn=foo\\+bar', [[('cn', 'foo+bar')]]), ('cn=foo\\+', [[('cn', 'foo+')]]), ('cn=\\"bar', [[('cn', '"bar')]]), ('cn=foo\\"bar', [[('cn', 'foo"bar')]]), ('cn=foo\\"', [[('cn', 'foo"')]]), ('cn=\\\\bar', [[('cn', '\\bar')]]), ('cn=foo\\\\bar', [[('cn', 'foo\\bar')]]), ('cn=foo\\\\', [[('cn', 'foo\\')]]), ('cn=\\<bar', [[('cn', '<bar')]]), ('cn=foo\\<bar', [[('cn', 'foo<bar')]]), ('cn=foo\\<', [[('cn', 'foo<')]]), ('cn=\\>bar', [[('cn', '>bar')]]), ('cn=foo\\>bar', [[('cn', 'foo>bar')]]), ('cn=foo\\>', [[('cn', 'foo>')]]), ('cn=\\;bar', [[('cn', ';bar')]]), ('cn=foo\\;bar', [[('cn', 'foo;bar')]]), ('cn=foo\\;', [[('cn', 'foo;')]]), ('cn=\\#bar', [[('cn', '#bar')]]), ('cn=\\ bar', [[('cn', ' bar')]]), ('cn=bar\\ ', [[('cn', 'bar ')]]), ('cn=test+owner=uid\\=foo\\,ou\\=department\\,dc\\=example\\,dc\\=com,dc=example,dc=com', [[('cn', 'test'), ('owner', 'uid=foo,ou=department,dc=example,dc=com')], [('dc', 'example')], [('dc', 'com')]]), ('cn=bar,dc=example,dc=com', [[('cn', 'bar')], [('dc', 'example')], [('dc', 'com')]]), ('cn=bar, dc=example, dc=com', [[('cn', 'bar')], [('dc', 'example')], [('dc', 'com')]]), ('cn=bar, dc=example,dc=com', [[('cn', 'bar')], [('dc', 'example')], [('dc', 'com')]]))¶
-
testOpenLDAPEqualsEscape
()¶ Slapd wants = to be escaped in RDN attributeValues.
-
-
class
OPSI.ldaptor.test.test_distinguishedname.
LDAPDistinguishedName_InitialSpaces
(methodName='runTest')¶ Bases:
OPSI.ldaptor.test.test_distinguishedname.TestCaseWithKnownValues
-
knownValues
= (('cn=foo, ou=bar, dc=quux, \\ attributeThatStartsWithSpace=Value', [[('cn', 'foo')], [('ou', 'bar')], [('dc', 'quux')], [(' attributeThatStartsWithSpace', 'Value')]]),)¶
-
-
class
OPSI.ldaptor.test.test_distinguishedname.
LDAPDistinguishedName_Malformed
(methodName='runTest')¶ Bases:
twisted.trial._asynctest.TestCase
-
testMalformed
()¶
-
-
class
OPSI.ldaptor.test.test_distinguishedname.
LDAPDistinguishedName_Prettify
(methodName='runTest')¶ Bases:
twisted.trial._asynctest.TestCase
-
testPrettifySpaces
()¶ str(DistinguishedName(...)) prettifies the DN by removing extra whitespace.
-
-
class
OPSI.ldaptor.test.test_distinguishedname.
LDAPDistinguishedName_RFC2253_Examples
(methodName='runTest')¶ Bases:
OPSI.ldaptor.test.test_distinguishedname.TestCaseWithKnownValues
-
knownValues
= (('CN=Steve Kille,O=Isode Limited,C=GB', [[('CN', 'Steve Kille')], [('O', 'Isode Limited')], [('C', 'GB')]]), ('OU=Sales+CN=J. Smith,O=Widget Inc.,C=US', [[('OU', 'Sales'), ('CN', 'J. Smith')], [('O', 'Widget Inc.')], [('C', 'US')]]), ('CN=L. Eagle,O=Sue\\, Grabbit and Runn,C=GB', [[('CN', 'L. Eagle')], [('O', 'Sue, Grabbit and Runn')], [('C', 'GB')]]), ('CN=Before\\0DAfter,O=Test,C=GB', [[('CN', 'Before\rAfter')], [('O', 'Test')], [('C', 'GB')]]), ('1.3.6.1.4.1.1466.0=#04024869,O=Test,C=GB', [[('1.3.6.1.4.1.1466.0', '#04024869')], [('O', 'Test')], [('C', 'GB')]]), ('SN=Lu\xc4\x8di\xc4\x87', [[('SN', 'Lu\xc4\x8di\xc4\x87')]]))¶
-
-
class
OPSI.ldaptor.test.test_distinguishedname.
LDAPDistinguishedName_contains
(methodName='runTest')¶ Bases:
twisted.trial._asynctest.TestCase
-
c
= DistinguishedName(listOfRDNs=(RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='com'),)),))¶
-
ec
= DistinguishedName(listOfRDNs=(RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='example'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='com'),))))¶
-
hsec
= DistinguishedName(listOfRDNs=(RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='cn', value='host'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='sub'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='example'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='com'),))))¶
-
oc
= DistinguishedName(listOfRDNs=(RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='other'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='com'),))))¶
-
other
= DistinguishedName(listOfRDNs=(RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='o', value='foo'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='c', value='US'),))))¶
-
root
= DistinguishedName(listOfRDNs=())¶
-
sec
= DistinguishedName(listOfRDNs=(RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='sub'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='example'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='com'),))))¶
-
shsec
= DistinguishedName(listOfRDNs=(RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='sub2'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='cn', value='host'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='sub'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='example'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='com'),))))¶
-
soc
= DistinguishedName(listOfRDNs=(RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='sub'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='other'),)), RelativeDistinguishedName(attributeTypesAndValues=(LDAPAttributeTypeAndValue(attributeType='dc', value='com'),))))¶
-
test_nonContainment_nonParents
()¶
-
test_nonContainment_parents
()¶
-
test_realContainment
()¶
-
test_selfContainment
()¶
-