forked from LBRYCommunity/lbry-sdk
fix and document new edge case on tests
This commit is contained in:
parent
6647dd8f08
commit
3946bc6662
1 changed files with 10 additions and 3 deletions
|
@ -51,8 +51,15 @@ class TestAESEncryptDecrypt(TestCase):
|
|||
better_aes_encrypt('super secret', b'valuable value')))
|
||||
|
||||
def test_better_decrypt_error(self):
|
||||
with self.assertRaises(InvalidPasswordError):
|
||||
better_aes_decrypt(
|
||||
try:
|
||||
value = better_aes_encrypt('super secret', b'valuable value')
|
||||
decrypted = better_aes_decrypt(
|
||||
'super secret but wrong',
|
||||
better_aes_encrypt('super secret', b'valuable value')
|
||||
value
|
||||
)
|
||||
print(f'{value} accepted as valid decryption.')
|
||||
# FIXME: example that hit here: czo4MTkyOjE2OjE6VrwsN8FSJlegxHVEQePoyjWT1k8yAXBCUbbGCFKcsNY=
|
||||
self.assertNotEqual(decrypted, b'valuable value')
|
||||
except InvalidPasswordError:
|
||||
# success
|
||||
pass
|
||||
|
|
Loading…
Reference in a new issue