From 60bbb278dded31ff3e6579ab7724d3624637e4d8 Mon Sep 17 00:00:00 2001 From: stroeder Date: Thu, 27 Apr 2017 08:36:54 +0000 Subject: [PATCH] added TestLdapCExtension.test_invalid_credentials() --- Tests/t_cext.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Tests/t_cext.py b/Tests/t_cext.py index 8778bb4..1da4116 100644 --- a/Tests/t_cext.py +++ b/Tests/t_cext.py @@ -692,6 +692,17 @@ def test_invalid_filter(self): else: self.fail("expected FILTER_ERROR, got %r" % r) + def test_invalid_credentials(self): + l = self._open_conn(bind=False) + # search with invalid filter + try: + m = l.simple_bind(self.server.root_dn, self.server.root_pw+'wrong') + r = l.result4(m, _ldap.MSG_ALL, self.timeout) + except _ldap.INVALID_CREDENTIALS: + pass + else: + self.fail("expected INVALID_CREDENTIALS, got %r" % r) + if __name__ == '__main__': unittest.main()