Skip to content

Commit d92435d

Browse files
author
stroeder
committed
added TestLDAPObject.test_errno107()
1 parent 0789a45 commit d92435d

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

Tests/t_ldapobject.py

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
test LDAP operations with Python wrapper module
2+
test LDAP operations with ldap.ldapobject
33
"""
44

55
import os
@@ -35,7 +35,7 @@
3535
"""
3636

3737

38-
class TestSearch(SlapdTestCase):
38+
class TestLDAPObject(SlapdTestCase):
3939
"""
4040
test LDAP search operations
4141
"""
@@ -124,5 +124,20 @@ def test_search_oneattr(self):
124124
[('cn=Foo4,ou=Container,'+self.server.suffix, {'cn': ['Foo4']})]
125125
)
126126

127+
def test_errno107(self):
128+
l = self.ldap_object_class('ldap://127.0.0.1:42')
129+
try:
130+
m = l.simple_bind_s("", "")
131+
r = l.result4(m, ldap.MSG_ALL, self.timeout)
132+
except ldap.SERVER_DOWN, ldap_err:
133+
errno = ldap_err.args[0]['errno']
134+
if errno != 107:
135+
self.fail("expected errno=107, got %d" % errno)
136+
info = ldap_err.args[0]['info']
137+
if info != os.strerror(107):
138+
self.fail("expected info=%r, got %d" % (os.strerror(107), info))
139+
else:
140+
self.fail("expected SERVER_DOWN, got %r" % r)
141+
127142
if __name__ == '__main__':
128143
unittest.main()

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy