From 0d7bf3133c0d64ef3d52f33cb21fb8e76a3ac69d Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Mon, 11 Sep 2017 17:32:56 -0300 Subject: [tests] fix test_unarmored_blob_encrypt flakiness AES can generate base64 valid strings, making this test flaky. Try to decrypt using armor=False instead. --- testing/tests/client/test_crypto.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'testing/tests') diff --git a/testing/tests/client/test_crypto.py b/testing/tests/client/test_crypto.py index bbbc4a43..5b647b73 100644 --- a/testing/tests/client/test_crypto.py +++ b/testing/tests/client/test_crypto.py @@ -119,9 +119,12 @@ class BlobTestCase(unittest.TestCase): def test_unarmored_blob_encrypt(self): self.blob.armor = False encrypted = yield self.blob.encrypt() - decode = base64.urlsafe_b64decode - with pytest.raises(TypeError): - assert map(decode, encrypted.getvalue().split()) + + decryptor = _crypto.BlobDecryptor( + self.doc_info, encrypted, armor=False, + secret='A' * 96) + decrypted = yield decryptor.decrypt() + assert decrypted.getvalue() == snowden1 @defer.inlineCallbacks def test_default_armored_blob_encrypt(self): -- cgit v1.2.3