diff options
| author | Victor Shyba <victor1984@riseup.net> | 2016-11-17 00:38:55 -0300 |
|---|---|---|
| committer | Victor Shyba <victor1984@riseup.net> | 2016-11-18 15:55:52 -0300 |
| commit | 8738544ab2de095ead1375e80d1222bd0639e2c0 (patch) | |
| tree | d959d836b6ae335682919c115c0a492b9ebc1f37 /testing/tests/sync/test_sync.py | |
| parent | 358874c8210dc779cea73b72e54934ae627c5711 (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.py | 19 |
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']) |
