Skip to content

Commit

Permalink
added ldap.dn tests with ldap.DN_FORMAT_LDAPV2
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder authored and Petr Viktorin committed Nov 22, 2017
1 parent 4a9591c commit 0a1e520
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Tests/t_ldap_dn.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,15 @@ def test_str2dn(self):
[('dc', 'com', 1)]
]
)
self.assertEqual(
ldap.dn.str2dn('uid=test42; ou=Testing; dc=example; dc=com', flags=ldap.DN_FORMAT_LDAPV2),
[
[('uid', 'test42', 1)],
[('ou', 'Testing', 1)],
[('dc', 'example', 1)],
[('dc', 'com', 1)]
]
)
self.assertEqual(
ldap.dn.str2dn('uid=test\\, 42,ou=Testing,dc=example,dc=com', flags=0),
[
Expand Down Expand Up @@ -175,6 +184,10 @@ def test_explode_dn(self):
ldap.dn.explode_dn('uid=test42,ou=Testing,dc=example,dc=com', flags=0),
['uid=test42', 'ou=Testing', 'dc=example', 'dc=com']
)
self.assertEqual(
ldap.dn.explode_dn('uid=test42; ou=Testing; dc=example; dc=com', flags=ldap.DN_FORMAT_LDAPV2),
['uid=test42', 'ou=Testing', 'dc=example', 'dc=com']
)
self.assertEqual(
ldap.dn.explode_dn('uid=test42,ou=Testing,dc=example,dc=com', notypes=True),
['test42', 'Testing', 'example', 'com']
Expand Down

0 comments on commit 0a1e520

Please sign in to comment.