summaryrefslogtreecommitdiff
path: root/src/leap/soledad/tests/__init__.py
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-05-15 20:25:00 -0300
committerTomás Touceda <chiiph@leap.se>2013-05-15 20:25:00 -0300
commitf216391f92ac0a52e11e9b13c149c8d40b446aeb (patch)
tree42d99a0a8e35d38bb168320b8a9841e290f978f8 /src/leap/soledad/tests/__init__.py
parent021078750d24162d24d7474f8b1fe97ef9467784 (diff)
parent7e6f458af4c7b51f414d6303942fec10dd56d2d3 (diff)
Merge remote-tracking branch 'drebs/feature/2349-add-mac-auth-3' into develop
Diffstat (limited to 'src/leap/soledad/tests/__init__.py')
-rw-r--r--src/leap/soledad/tests/__init__.py16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/leap/soledad/tests/__init__.py b/src/leap/soledad/tests/__init__.py
index 6787aa9d..07038910 100644
--- a/src/leap/soledad/tests/__init__.py
+++ b/src/leap/soledad/tests/__init__.py
@@ -10,7 +10,7 @@ from leap.soledad import Soledad
from leap.soledad.crypto import SoledadCrypto
from leap.soledad.backends.leap_backend import (
LeapDocument,
- decrypt_doc_json,
+ decrypt_doc,
ENC_SCHEME_KEY,
)
from leap.common.testing.basetest import BaseLeapTest
@@ -44,7 +44,8 @@ class BaseSoledadTest(BaseLeapTest):
self._db2.close()
self._soledad.close()
- def _soledad_instance(self, user='leap@leap.se', passphrase='123', prefix='',
+ def _soledad_instance(self, user='leap@leap.se', passphrase='123',
+ prefix='',
secrets_path=Soledad.STORAGE_SECRETS_FILE_NAME,
local_db_path='/soledad.u1db', server_url='',
cert_file=None):
@@ -69,15 +70,16 @@ class BaseSoledadTest(BaseLeapTest):
server_url=server_url, # Soledad will fail if not given an url.
cert_file=cert_file)
- def assertGetEncryptedDoc(self, db, doc_id, doc_rev, content, has_conflicts):
- """Assert that the document in the database looks correct."""
+ def assertGetEncryptedDoc(
+ self, db, doc_id, doc_rev, content, has_conflicts):
+ """
+ Assert that the document in the database looks correct.
+ """
exp_doc = self.make_document(doc_id, doc_rev, content,
has_conflicts=has_conflicts)
doc = db.get_doc(doc_id)
if ENC_SCHEME_KEY in doc.content:
- doc.set_json(
- decrypt_doc_json(
- self._soledad._crypto, doc.doc_id, doc.get_json()))
+ doc.set_json(decrypt_doc(self._soledad._crypto, doc))
self.assertEqual(exp_doc.doc_id, doc.doc_id)
self.assertEqual(exp_doc.rev, doc.rev)
self.assertEqual(exp_doc.has_conflicts, doc.has_conflicts)