From eb0417858eba81198c21bd6ba94d7a964989bccc Mon Sep 17 00:00:00 2001 From: Sergi Delgado Segura Date: Thu, 7 Nov 2019 16:42:06 +0000 Subject: [PATCH] Adds missing test for EncryptedBlob --- test/unit/test_encrypted_blob.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/test_encrypted_blob.py b/test/unit/test_encrypted_blob.py index 19098a8..3bc0d1d 100644 --- a/test/unit/test_encrypted_blob.py +++ b/test/unit/test_encrypted_blob.py @@ -11,6 +11,14 @@ def test_init_encrypted_blob(): assert EncryptedBlob(data).data == data +def test_equal(): + data = get_random_value_hex(64) + e_blob1 = EncryptedBlob(data) + e_blob2 = EncryptedBlob(data) + + assert e_blob1 == e_blob2 and id(e_blob1) != id(e_blob2) + + def test_decrypt(): # TODO: The decryption tests are assuming the cipher is AES-GCM-128, since EncryptedBlob assumes the same. Fix this. key = get_random_value_hex(32)