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()