Exemplo n.º 1
0
 def test_modified_cookie(self):
     dct = {'a': 'asdfsafdsdf', 'id': 4}
     name = 'somevalue'
     sign = SignCmd(name, dct)
     sign.execute()
     self.assertIsNotNone(sign.result)
     retrieve = RetrieveCmd(name, sign.result[1:], 100)
     retrieve.execute()
     self.assertIsNone(retrieve.result)
Exemplo n.º 2
0
 def test_sign_and_retrive(self):
     dct = {'a': 'asdfsafdsdf', 'id': 4}
     name = 'somevalue'
     sign = SignCmd(name, dct)
     sign.execute()
     self.assertIsNotNone(sign.result)
     retrieve = RetrieveCmd(name, sign.result, 100)
     retrieve.execute()
     self.assertDictEqual(dct, retrieve.result)
Exemplo n.º 3
0
 def test_expired(self):
     dct = {'a': 'asdfsafdsdf', 'id': 4}
     name = 'somevalue'
     sign = SignCmd(name, dct)
     sign.execute()
     self.assertIsNotNone(sign.result)
     retrieve = RetrieveCmd(name, sign.result, 1)
     time.sleep(2)
     retrieve.execute()
     self.assertIsNone(retrieve.result)