summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorBruno Wagner <bwgpro@gmail.com>2015-08-07 15:19:38 -0300
committerBruno Wagner <bwgpro@gmail.com>2015-08-12 17:17:18 -0300
commit2d5bf3c61642989d575dae9f248820392110320c (patch)
tree17eb258cfe2dfdb2ee5d69b25806eca18ace077a /common
parent75990a3a3f842e251cefad46ee055d23efb52521 (diff)
[tests] Pulled test scenario req into sqlcipher sync test
Pulled the requirement for the test scenario in sqlcipher sync so we could remove the dependency on the u1db test_sync
Diffstat (limited to 'common')
-rw-r--r--common/src/leap/soledad/common/tests/test_sqlcipher_sync.py13
1 files changed, 11 insertions, 2 deletions
diff --git a/common/src/leap/soledad/common/tests/test_sqlcipher_sync.py b/common/src/leap/soledad/common/tests/test_sqlcipher_sync.py
index 3a92047f..d3f45114 100644
--- a/common/src/leap/soledad/common/tests/test_sqlcipher_sync.py
+++ b/common/src/leap/soledad/common/tests/test_sqlcipher_sync.py
@@ -38,7 +38,6 @@ from leap.soledad.client.sqlcipher import (
)
from leap.soledad.common.tests import u1db_tests as tests
-from leap.soledad.common.tests.u1db_tests import test_sync
from leap.soledad.common.tests.test_sqlcipher import SQLCIPHER_SCENARIOS
from leap.soledad.common.tests.util import (
make_soledad_app,
@@ -66,9 +65,19 @@ def sync_via_synchronizer_and_soledad(test, db_source, db_target,
return sync.Synchronizer(db_source, target).sync()
+def sync_via_synchronizer(test, db_source, db_target,
+ trace_hook=None,
+ trace_hook_shallow=None):
+ target = db_target.get_sync_target()
+ trace_hook = trace_hook or trace_hook_shallow
+ if trace_hook:
+ target._set_trace_hook(trace_hook)
+ return sync.Synchronizer(db_source, target).sync()
+
+
sync_scenarios = []
for name, scenario in SQLCIPHER_SCENARIOS:
- scenario['do_sync'] = test_sync.sync_via_synchronizer
+ scenario['do_sync'] = sync_via_synchronizer
sync_scenarios.append((name, scenario))