summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-09-11 17:32:56 -0300
committerVictor Shyba <victor1984@riseup.net>2017-09-11 17:32:56 -0300
commit0d7bf3133c0d64ef3d52f33cb21fb8e76a3ac69d (patch)
treebf79cfd2aa2b535ebae8eadb60583e5db949242d
parent80a5dcaf3d03267dcf3ff9e16fd5a54ef4a45f8d (diff)
[tests] fix test_unarmored_blob_encrypt flakiness
AES can generate base64 valid strings, making this test flaky. Try to decrypt using armor=False instead.
-rw-r--r--testing/tests/client/test_crypto.py9
1 files changed, 6 insertions, 3 deletions
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):