Skip to content

Commit

Permalink
new test-cases in t_ldap_dn.py
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Feb 14, 2017
1 parent 0d9faae commit bec33ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ Tests/
* new test scripts t_ldap_schema_tokenizer.py and t_ldap_modlist.py
on former raw scripts
* new test-cases in t_ldapurl.py based on former raw scripts
* new test-cases in t_ldap_dn.py

----------------------------------------------------------------
Released 2.4.30 2017-02-08
Expand Down Expand Up @@ -1327,4 +1328,4 @@ Released 2.0.0pre02 2002-02-01
----------------------------------------------------------------
Released 1.10alpha3 2000-09-19

$Id: CHANGES,v 1.405 2017/02/14 13:37:51 stroeder Exp $
$Id: CHANGES,v 1.406 2017/02/14 18:02:20 stroeder Exp $
11 changes: 10 additions & 1 deletion Tests/t_ldap_dn.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,17 @@ def test_is_dn(self):
test function is_dn()
"""
self.assertEquals(ldap.dn.is_dn('foobar,ou=ae-dir'), False)
self.assertEquals(ldap.dn.is_dn('-cn=foobar,ou=ae-dir'), False)
self.assertEquals(ldap.dn.is_dn(';cn=foobar,ou=ae-dir'), False)
self.assertEquals(ldap.dn.is_dn(',cn=foobar,ou=ae-dir'), False)
self.assertEquals(ldap.dn.is_dn('cn=foobar,ou=ae-dir,'), False)
self.assertEquals(ldap.dn.is_dn('uid=xkcd,cn=foobar,ou=ae-dir'), True)

self.assertEquals(
ldap.dn.is_dn(
'cn=\xc3\xa4\xc3\xb6\xc3\xbc\xc3\x84\xc3\x96\xc3\x9c.o=\xc3\xa4\xc3\xb6\xc3\xbc\xc3\x84\xc3\x96\xc3\x9c\xc3\x9f'
),
True
)

if __name__ == '__main__':
unittest.main()

0 comments on commit bec33ba

Please sign in to comment.