File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 1
1
"""
2
- test LDAP operations with Python wrapper module
2
+ test LDAP operations with ldap.ldapobject
3
3
"""
4
4
5
5
import os
35
35
"""
36
36
37
37
38
- class TestSearch (SlapdTestCase ):
38
+ class TestLDAPObject (SlapdTestCase ):
39
39
"""
40
40
test LDAP search operations
41
41
"""
@@ -124,5 +124,20 @@ def test_search_oneattr(self):
124
124
[('cn=Foo4,ou=Container,' + self .server .suffix , {'cn' : ['Foo4' ]})]
125
125
)
126
126
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
+
127
142
if __name__ == '__main__' :
128
143
unittest .main ()
You can’t perform that action at this time.
0 commit comments