Skip to content

Commit

Permalink
added Test01_ReconnectLDAPObject.test104_reconnect_restore()
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder authored and Petr Viktorin committed Nov 22, 2017
1 parent 657ea2b commit be191b1
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Tests/t_ldapobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def test103_reconnect_get_state(self):
l1.__getstate__(),
{
'_last_bind': (
SimpleLDAPObject.simple_bind_s,
'simple_bind_s',
(bind_dn, 'user1_pw'),
{}
),
Expand All @@ -238,6 +238,16 @@ def test103_reconnect_get_state(self):
},
)

def test104_reconnect_restore(self):
l1 = self.ldap_object_class(self.server.ldapi_uri)
bind_dn = 'cn=user1,'+self.server.suffix
l1.simple_bind_s(bind_dn, 'user1_pw')
self.assertEqual(l1.whoami_s(), 'dn:'+bind_dn)
l1_state = pickle.dumps(l1)
del l1
l2 = pickle.loads(l1_state)
self.assertEqual(l2.whoami_s(), 'dn:'+bind_dn)


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

0 comments on commit be191b1

Please sign in to comment.