示例#1
0
 def test_challenge_failed(self):
     salt = b'salt'
     digest = hashlib.md5(b'message').digest()
     val = DigestValue(salt, digest, hashlib.md5)
     with pytest.raises(ValueError):
         val.challenge(b'm3ssage')
示例#2
0
 def test_challenge_success(self):
     salt = b'salt'
     digest = hashlib.md5(b'saltmessage').digest()
     val = DigestValue(salt, digest, hashlib.md5)
     val.challenge('message')
     val.challenge(b'message')