summaryrefslogtreecommitdiff
path: root/common/src/leap/soledad
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-12-01 13:07:14 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-12-01 13:07:14 -0300
commit332ce9e68a34e2ddc31ef371c991565e5e38812b (patch)
tree923dfe2bc7a8d035ac5325ca1614cc6283c062f5 /common/src/leap/soledad
parentb44a2a9b3894e438bbb2b18da6e22f86602655af (diff)
[tests] encdec pool is being reused, adding a test
This new test case will run the single insert test 5 times to ensure that using the same pool again is fine. This is needed due failures to shutdown the pool or inconsistency between syncs.
Diffstat (limited to 'common/src/leap/soledad')
-rw-r--r--common/src/leap/soledad/common/tests/test_encdecpool.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/src/leap/soledad/common/tests/test_encdecpool.py b/common/src/leap/soledad/common/tests/test_encdecpool.py
index 793bfa1a..27247c94 100644
--- a/common/src/leap/soledad/common/tests/test_encdecpool.py
+++ b/common/src/leap/soledad/common/tests/test_encdecpool.py
@@ -171,12 +171,22 @@ class TestSyncDecrypterPool(BaseSoledadTest):
DOC_ID, DOC_REV, encrypted_content, 1, "trans_id", 1)
def _assert_doc_was_decrypted_and_inserted(_):
+ self.assertEqual(1, len(self._inserted_docs))
self.assertEqual(self._inserted_docs, [(doc, 1, u"trans_id")])
self._pool.deferred.addCallback(
_assert_doc_was_decrypted_and_inserted)
return self._pool.deferred
+ @inlineCallbacks
+ def test_pool_reuse(self):
+ """
+ The pool is reused between syncs, this test verifies that
+ reusing is fine.
+ """
+ for _ in xrange(5):
+ yield self.test_insert_encrypted_received_doc()
+
def test_insert_encrypted_received_doc_many(self):
"""
Test that many encrypted documents added to the pool are decrypted and