'hk', 0, 60); #sessions may last at most 60 seconds if s is None: print '[err]: ', scs.err(s) raise Exception # basic encoding/decoding tests test('some cool state 1') test('some other state 2') # test key refresh scs.refresh_keyset(s, 'tid2', 'k2', 'hk2') test('some other cool state 3 after key refresh') # cleanup scs.term(s) print 'All tests passed.' except Exception: # cleanup if s != None: scs.term(s) print 'Failure in tests!'
def __del__(self): if self.s: scs.term(self.s)