Skip to content

Commit

Permalink
added TestLdapCExtension.test_invalid_filter()
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Apr 26, 2017
1 parent 0a5b1e1 commit 014a74f
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions Tests/t_cext.py
Original file line number Diff line number Diff line change
Expand Up @@ -676,6 +676,22 @@ def test_errno107(self):
else:
self.fail("expected SERVER_DOWN, got %r" % r)

def test_invalid_filter(self):
l = self._open_conn(bind=False)
# search with invalid filter
try:
m = l.search_ext(
"",
_ldap.SCOPE_BASE,
'(|(objectClass=*)',
)
self.assertEqual(type(m), type(0))
r = l.result4(m, _ldap.MSG_ALL, self.timeout)
except _ldap.FILTER_ERROR:
pass
else:
self.fail("expected FILTER_ERROR, got %r" % r)


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

0 comments on commit 014a74f

Please sign in to comment.