diff options
author | Victor Shyba <victor1984@riseup.net> | 2016-11-30 00:07:24 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2016-12-12 09:17:51 -0200 |
commit | 694e5670da53e923cf809948e400cd546154162b (patch) | |
tree | 1e81c5f098e00e806377564b5ffd449f0f4e66ca /testing/tests/server/test_server.py | |
parent | 5a1827f87dafbf64cfd39dd26e1923a456f05d44 (diff) |
[refactor] improve blob signature magic usage
Our magic value wasn't being used and were represented as a string.
Refactored it to a constant, increased it's size to 2 bytes and optimzed
is_symmetrically_encrypted to look for the magic and symmetrically
encrypted flag under base64 encoding. Most file types will use this
feature to help identifying themselves, so it got refactored to serve
the purpose it was created.
Diffstat (limited to 'testing/tests/server/test_server.py')
-rw-r--r-- | testing/tests/server/test_server.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/testing/tests/server/test_server.py b/testing/tests/server/test_server.py index 2f958b29..6710caaf 100644 --- a/testing/tests/server/test_server.py +++ b/testing/tests/server/test_server.py @@ -413,7 +413,8 @@ class EncryptedSyncTestCase( self.assertEqual(soldoc.rev, couchdoc.rev) couch_content = couchdoc.content.keys() self.assertEqual(['raw'], couch_content) - self.assertTrue(_crypto.is_symmetrically_encrypted(couchdoc)) + content = couchdoc.get_json() + self.assertTrue(_crypto.is_symmetrically_encrypted(content)) d = sol1.get_all_docs() d.addCallback(_db1AssertEmptyDocList) |