From 332ce9e68a34e2ddc31ef371c991565e5e38812b Mon Sep 17 00:00:00 2001 From: Victor Shyba Date: Tue, 1 Dec 2015 13:07:14 -0300 Subject: [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. --- common/src/leap/soledad/common/tests/test_encdecpool.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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 -- cgit v1.2.3