Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
leap
soledad
Commits
fcdcd596
Verified
Commit
fcdcd596
authored
Dec 14, 2017
by
Victor
Browse files
[test] ciphertext size function tests
parent
390703b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/client/test_crypto.py
View file @
fcdcd596
...
...
@@ -126,6 +126,19 @@ class BlobTestCase(unittest.TestCase):
decrypted
=
yield
decryptor
.
decrypt
()
assert
decrypted
.
getvalue
()
==
snowden1
@
defer
.
inlineCallbacks
def
test_get_unarmored_ciphertext_size
(
self
):
for
size_to_test
in
xrange
(
-
1
,
400
):
test_content
=
'
\x00
'
*
size_to_test
size
=
_crypto
.
get_unarmored_ciphertext_size
(
len
(
test_content
))
inf
=
BytesIO
(
test_content
)
blob
=
_crypto
.
BlobEncryptor
(
self
.
doc_info
,
inf
,
armor
=
False
,
secret
=
'A'
*
96
)
encrypted
=
yield
blob
.
encrypt
()
assert
len
(
encrypted
.
getvalue
())
==
size
,
size_to_test
@
defer
.
inlineCallbacks
def
test_default_armored_blob_encrypt
(
self
):
encrypted
=
yield
self
.
blob
.
encrypt
()
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment