示例#1
0
文件: test.py 项目: magopian/receipts
 def test_sig(self):
     res = certs.parse_jwt(jwt.encode(self.jwk, 'key'))
     self.failUnlessRaises(ValueError, res.check_signature,
         {'alg': 'HS256', 'exp': 'AQAB', 'mod': 'AQAB'})
示例#2
0
文件: test.py 项目: magopian/receipts
 def test_not_sig(self):
     res = certs.parse_jwt(jwt.encode(self.jwk, 'key'))
     ok_(not res.check_signature(self.jwk['jwk'][0]))
示例#3
0
文件: test.py 项目: magopian/receipts
 def test_parse(self):
     res = certs.parse_jwt(jwt.encode(self.jwk, 'key'))
     ok_(isinstance(res, certs.ReceiptJWT))
示例#4
0
 def test_sig(self):
     res = certs.parse_jwt(jwt.encode(self.jwk, "key"))
     self.failUnlessRaises(ValueError, res.check_signature, {"alg": "HS256", "exp": "AQAB", "mod": "AQAB"})
示例#5
0
 def test_not_sig(self):
     res = certs.parse_jwt(jwt.encode(self.jwk, "key"))
     ok_(not res.check_signature(self.jwk["jwk"][0]))
示例#6
0
 def test_parse(self):
     res = certs.parse_jwt(jwt.encode(self.jwk, "key"))
     ok_(isinstance(res, certs.ReceiptJWT))