예제 #1
0
파일: test.py 프로젝트: sanyaade-iot/libscs
            '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!'

예제 #2
0
파일: modpyscs.py 프로젝트: babongo/libscs
    def __del__(self):

        if self.s:
            scs.term(self.s)
예제 #3
0
    def __del__(self):

        if self.s:
            scs.term(self.s)