File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ def test103_reconnect_get_state(self):
222
222
l1 .__getstate__ (),
223
223
{
224
224
'_last_bind' : (
225
- SimpleLDAPObject . simple_bind_s ,
225
+ ' simple_bind_s' ,
226
226
(bind_dn , 'user1_pw' ),
227
227
{}
228
228
),
@@ -238,6 +238,16 @@ def test103_reconnect_get_state(self):
238
238
},
239
239
)
240
240
241
+ def test104_reconnect_restore (self ):
242
+ l1 = self .ldap_object_class (self .server .ldapi_uri )
243
+ bind_dn = 'cn=user1,' + self .server .suffix
244
+ l1 .simple_bind_s (bind_dn , 'user1_pw' )
245
+ self .assertEqual (l1 .whoami_s (), 'dn:' + bind_dn )
246
+ l1_state = pickle .dumps (l1 )
247
+ del l1
248
+ l2 = pickle .loads (l1_state )
249
+ self .assertEqual (l2 .whoami_s (), 'dn:' + bind_dn )
250
+
241
251
242
252
if __name__ == '__main__' :
243
253
unittest .main ()
You can’t perform that action at this time.
0 commit comments