Skip to content

Commit 014a74f

Browse files
author
stroeder
committed
added TestLdapCExtension.test_invalid_filter()
1 parent 0a5b1e1 commit 014a74f

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Tests/t_cext.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -676,6 +676,22 @@ def test_errno107(self):
676676
else:
677677
self.fail("expected SERVER_DOWN, got %r" % r)
678678

679+
def test_invalid_filter(self):
680+
l = self._open_conn(bind=False)
681+
# search with invalid filter
682+
try:
683+
m = l.search_ext(
684+
"",
685+
_ldap.SCOPE_BASE,
686+
'(|(objectClass=*)',
687+
)
688+
self.assertEqual(type(m), type(0))
689+
r = l.result4(m, _ldap.MSG_ALL, self.timeout)
690+
except _ldap.FILTER_ERROR:
691+
pass
692+
else:
693+
self.fail("expected FILTER_ERROR, got %r" % r)
694+
679695

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

0 commit comments

Comments
 (0)