summaryrefslogtreecommitdiff
path: root/testing/tests/sync/test_sync.py
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-11-17 00:38:55 -0300
committerdrebs <drebs@leap.se>2016-12-12 09:12:01 -0200
commit632cd2414a47bc7f471d8f501ab6250293aedf51 (patch)
tree6a7be8a330ad33c4e8c28bc6cfd6fdef483beb66 /testing/tests/sync/test_sync.py
parent1be8f24264d7c0e9c8616faa64c206954fa5c342 (diff)
[bug] include_deleted=True on sync
Also refactored tests and code to stop relying on old parameters which included docs instead of get_doc calls.
Diffstat (limited to 'testing/tests/sync/test_sync.py')
-rw-r--r--testing/tests/sync/test_sync.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/testing/tests/sync/test_sync.py b/testing/tests/sync/test_sync.py
index a434e944..76757c5b 100644
--- a/testing/tests/sync/test_sync.py
+++ b/testing/tests/sync/test_sync.py
@@ -19,6 +19,7 @@ import threading
import time
from urlparse import urljoin
+from mock import Mock
from twisted.internet import defer
from testscenarios import TestWithScenarios
@@ -210,3 +211,21 @@ class TestSoledadDbSync(
self.db, doc2.doc_id, doc2.rev, tests.nested_doc, False)
# TODO: add u1db.tests.test_sync.TestRemoteSyncIntegration
+
+
+class TestSoledadSynchronizer(BaseSoledadTest):
+
+ def setUp(self):
+ BaseSoledadTest.setUp(self)
+ self.db = Mock()
+ self.target = Mock()
+ self.synchronizer = sync.SoledadSynchronizer(
+ self.db,
+ self.target)
+
+ def test_docs_by_gen_includes_deleted(self):
+ changes = [('id', 'gen', 'trans')]
+ docs_by_gen = self.synchronizer._docs_by_gen_from_changes(changes)
+ f, args, kwargs = docs_by_gen[0][0]
+ self.assertIn('include_deleted', kwargs)
+ self.assertTrue(kwargs['include_deleted'])