From 3fb192f92740a7cf60a28d823291760688a9ed69 Mon Sep 17 00:00:00 2001 From: stroeder Date: Sun, 24 Jul 2016 15:40:17 +0000 Subject: [PATCH] tests for ldap.dn.is_dn() --- Tests/t_ldap_dn.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Tests/t_ldap_dn.py diff --git a/Tests/t_ldap_dn.py b/Tests/t_ldap_dn.py new file mode 100644 index 0000000..553e2e5 --- /dev/null +++ b/Tests/t_ldap_dn.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +""" +Automatic tests for module ldap.functions +""" + +# from Python's standard lib +import unittest + +# from python-ldap +import ldap.dn + + +class TestDN(unittest.TestCase): + """ + test ldap.functions + """ + + 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('uid=xkcd,cn=foobar,ou=ae-dir'), True) + + +if __name__ == '__main__': + unittest.main()