Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
soledad
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
leap
soledad
Commits
fcdcd596
Verified
Commit
fcdcd596
authored
7 years ago
by
Victor
Browse files
Options
Downloads
Patches
Plain Diff
[test] ciphertext size function tests
parent
390703b4
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!172
Upstreaming blobs
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/client/test_crypto.py
+13
-0
13 additions, 0 deletions
tests/client/test_crypto.py
with
13 additions
and
0 deletions
tests/client/test_crypto.py
+
13
−
0
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
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment