diff options
author | drebs <drebs@leap.se> | 2014-06-06 16:48:52 -0300 |
---|---|---|
committer | drebs <drebs@leap.se> | 2014-06-06 16:48:52 -0300 |
commit | a371d0cf47589c7a429074543e5c930c30481ebe (patch) | |
tree | da12dce58b0e1c7e38caccfc41e8fe29a92d1039 /common/src/leap/soledad/common/tests/test_couch_operations_atomicity.py | |
parent | 16dbfbc3f14296587ebef9a65e69d7bf1b9dcb0e (diff) | |
parent | 5cb40a959af827e4eadde1c047664c4f4c0ae01d (diff) |
Merge tag '0.5.1' into deb-0.5.2
Tag leap.soledad.version 0.5.1
Diffstat (limited to 'common/src/leap/soledad/common/tests/test_couch_operations_atomicity.py')
-rw-r--r-- | common/src/leap/soledad/common/tests/test_couch_operations_atomicity.py | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/common/src/leap/soledad/common/tests/test_couch_operations_atomicity.py b/common/src/leap/soledad/common/tests/test_couch_operations_atomicity.py index 3c457cc5..b03f79e7 100644 --- a/common/src/leap/soledad/common/tests/test_couch_operations_atomicity.py +++ b/common/src/leap/soledad/common/tests/test_couch_operations_atomicity.py @@ -24,6 +24,10 @@ import mock import tempfile import threading + +from urlparse import urljoin + + from leap.soledad.client import Soledad from leap.soledad.common.couch import CouchDatabase, CouchServerState from leap.soledad.common.tests.test_couch import CouchDBTestCase @@ -101,12 +105,16 @@ class CouchAtomicityTestCase(CouchDBTestCase, TestCaseWithServer): TestCaseWithServer.setUp(self) CouchDBTestCase.setUp(self) self._couch_url = 'http://localhost:' + str(self.wrapper.port) - self.db = CouchDatabase( - self._couch_url, 'user-user-uuid', replica_uid='replica') + self.db = CouchDatabase.open_database( + urljoin(self._couch_url, 'user-user-uuid'), + create=True, + replica_uid='replica', + ensure_ddocs=True) self.tempdir = tempfile.mkdtemp(prefix="leap_tests-") def tearDown(self): self.db.delete_database() + self.db.close() CouchDBTestCase.tearDown(self) TestCaseWithServer.tearDown(self) @@ -211,6 +219,7 @@ class CouchAtomicityTestCase(CouchDBTestCase, TestCaseWithServer): _create_docs_and_sync(sol, 0) _create_docs_and_sync(sol, 1) + sol.close() # # Concurrency tests @@ -344,6 +353,7 @@ class CouchAtomicityTestCase(CouchDBTestCase, TestCaseWithServer): self.assertEqual( 1, len(filter(lambda t: t[0] == doc_id, transaction_log))) + sol.close() def test_concurrent_syncs_do_not_fail(self): """ @@ -387,3 +397,4 @@ class CouchAtomicityTestCase(CouchDBTestCase, TestCaseWithServer): self.assertEqual( 1, len(filter(lambda t: t[0] == doc_id, transaction_log))) + sol.close() |