summaryrefslogtreecommitdiff
path: root/tests/test_encrypted.py
diff options
context:
space:
mode:
authordrebs <drebs@joselito.semvergonha.org>2013-03-07 16:34:22 -0300
committerdrebs <drebs@joselito.semvergonha.org>2013-03-07 16:34:22 -0300
commit1b1def113e6ed9b8af6897e16f0d9b4c96bbfa6b (patch)
treec34b751dde12bc92628165e8af902da54e39e898 /tests/test_encrypted.py
parent4672ec4f25daa6466b2850bea416eaf77fa90d9d (diff)
Move source files to subfolder.
Diffstat (limited to 'tests/test_encrypted.py')
-rw-r--r--tests/test_encrypted.py39
1 files changed, 0 insertions, 39 deletions
diff --git a/tests/test_encrypted.py b/tests/test_encrypted.py
deleted file mode 100644
index 4a48266e..00000000
--- a/tests/test_encrypted.py
+++ /dev/null
@@ -1,39 +0,0 @@
-from leap.soledad.backends.leap_backend import LeapDocument
-from leap.soledad.tests import BaseSoledadTest
-from leap.soledad.tests import KEY_FINGERPRINT
-
-try:
- import simplejson as json
-except ImportError:
- import json # noqa
-
-
-class EncryptedSyncTestCase(BaseSoledadTest):
- """
- Tests that guarantee that data will always be encrypted when syncing.
- """
-
- def test_get_set_encrypted_json(self):
- """
- Test getting and setting encrypted content.
- """
- doc1 = LeapDocument(soledad=self._soledad)
- doc1.content = {'key': 'val'}
- doc2 = LeapDocument(doc_id=doc1.doc_id,
- encrypted_json=doc1.get_encrypted_json(),
- soledad=self._soledad)
- res1 = doc1.get_json()
- res2 = doc2.get_json()
- self.assertEqual(res1, res2, 'incorrect document encryption')
-
- def test_successful_symmetric_encryption(self):
- """
- Test for successful symmetric encryption.
- """
- doc1 = LeapDocument(soledad=self._soledad)
- doc1.content = {'key': 'val'}
- enc_json = json.loads(doc1.get_encrypted_json())['_encrypted_json']
- self.assertEqual(
- True,
- self._soledad._gpg.is_encrypted_sym(enc_json),
- "could not encrypt with passphrase.")