Skip to content

Commit

Permalink
added TestLdapCExtension.test_invalid_credentials()
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Apr 27, 2017
1 parent d92435d commit 60bbb27
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Tests/t_cext.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit 60bbb27

Please sign in to comment.