From 926ee07eb372ff9250cbd66d4e9c5153323a521b Mon Sep 17 00:00:00 2001 From: stroeder Date: Sun, 24 Jul 2016 16:03:46 +0000 Subject: [PATCH] tests for ldap.filter --- Tests/t_ldap_filter.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 Tests/t_ldap_filter.py diff --git a/Tests/t_ldap_filter.py b/Tests/t_ldap_filter.py new file mode 100644 index 0000000..9ba3f5a --- /dev/null +++ b/Tests/t_ldap_filter.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +""" +Automatic tests for module ldap.filter +""" + +# from Python's standard lib +import unittest + +# from python-ldap +from ldap.filter import escape_filter_chars + + +class TestDN(unittest.TestCase): + """ + test ldap.functions + """ + + def test_escape_filter_chars(self): + """ + test function is_dn() + """ + self.assertEquals(escape_filter_chars(r'foobar'), 'foobar') + self.assertEquals(escape_filter_chars(r'foo\bar'), r'foo\5cbar') + + +if __name__ == '__main__': + unittest.main()