Skip to content

Commit

Permalink
added TestLDAPObject.test_invalid_credentials()
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Apr 27, 2017
1 parent 60bbb27 commit 44304ca
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Tests/t_ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,5 +139,17 @@ def test_errno107(self):
else:
self.fail("expected SERVER_DOWN, got %r" % r)

def test_invalid_credentials(self):
l = self.ldap_object_class(self.server.ldap_uri)
# 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)
except ldap.INVALID_CREDENTIALS:
pass
else:
self.fail("expected INVALID_CREDENTIALS, got %r" % r)


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

0 comments on commit 44304ca

Please sign in to comment.