Skip to content

Commit e968f91

Browse files
author
stroeder
committed
added ldap.dn tests with ldap.DN_FORMAT_LDAPV2
1 parent 50d6f1f commit e968f91

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Tests/t_ldap_dn.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ def test_str2dn(self):
7878
[('dc', 'com', 1)]
7979
]
8080
)
81+
self.assertEqual(
82+
ldap.dn.str2dn('uid=test42; ou=Testing; dc=example; dc=com', flags=ldap.DN_FORMAT_LDAPV2),
83+
[
84+
[('uid', 'test42', 1)],
85+
[('ou', 'Testing', 1)],
86+
[('dc', 'example', 1)],
87+
[('dc', 'com', 1)]
88+
]
89+
)
8190
self.assertEqual(
8291
ldap.dn.str2dn('uid=test\\, 42,ou=Testing,dc=example,dc=com', flags=0),
8392
[
@@ -175,6 +184,10 @@ def test_explode_dn(self):
175184
ldap.dn.explode_dn('uid=test42,ou=Testing,dc=example,dc=com', flags=0),
176185
['uid=test42', 'ou=Testing', 'dc=example', 'dc=com']
177186
)
187+
self.assertEqual(
188+
ldap.dn.explode_dn('uid=test42; ou=Testing; dc=example; dc=com', flags=ldap.DN_FORMAT_LDAPV2),
189+
['uid=test42', 'ou=Testing', 'dc=example', 'dc=com']
190+
)
178191
self.assertEqual(
179192
ldap.dn.explode_dn('uid=test42,ou=Testing,dc=example,dc=com', notypes=True),
180193
['test42', 'Testing', 'example', 'com']

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy