summaryrefslogtreecommitdiff
path: root/testing/tests/sync
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2016-11-17 01:33:04 -0300
committerdrebs <drebs@leap.se>2016-12-12 09:13:09 -0200
commit529dbdf27804f12da80907d25c412d10e9fa3763 (patch)
tree34e7978593562feb05b65492f951c87ccba90551 /testing/tests/sync
parent632cd2414a47bc7f471d8f501ab6250293aedf51 (diff)
[style] fix pep8 and confs
Fixes setup.cfg, adding current exclude rules, simplified tox.ini to use setup.cfg and fixed all.
Diffstat (limited to 'testing/tests/sync')
-rw-r--r--testing/tests/sync/test_sqlcipher_sync.py1
-rw-r--r--testing/tests/sync/test_sync_mutex.py1
-rw-r--r--testing/tests/sync/test_sync_target.py11
3 files changed, 9 insertions, 4 deletions
diff --git a/testing/tests/sync/test_sqlcipher_sync.py b/testing/tests/sync/test_sqlcipher_sync.py
index 029164eb..26f63a40 100644
--- a/testing/tests/sync/test_sqlcipher_sync.py
+++ b/testing/tests/sync/test_sqlcipher_sync.py
@@ -710,6 +710,7 @@ def make_local_db_and_soledad_target(
source_replica_uid=source_replica_uid)
return db, st
+
target_scenarios = [
('leap', {
'create_db_and_target': make_local_db_and_soledad_target,
diff --git a/testing/tests/sync/test_sync_mutex.py b/testing/tests/sync/test_sync_mutex.py
index 2bcb3aec..432a3cd2 100644
--- a/testing/tests/sync/test_sync_mutex.py
+++ b/testing/tests/sync/test_sync_mutex.py
@@ -66,6 +66,7 @@ def _timed_sync(self):
d.addBoth(_store_finish_time)
return d
+
SoledadSynchronizer.sync = _timed_sync
# -- end of monkey-patching
diff --git a/testing/tests/sync/test_sync_target.py b/testing/tests/sync/test_sync_target.py
index e32f08b3..dd69ffa1 100644
--- a/testing/tests/sync/test_sync_target.py
+++ b/testing/tests/sync/test_sync_target.py
@@ -412,7 +412,8 @@ class SoledadDatabaseSyncTargetTests(
This test was adapted to decrypt remote content before assert.
"""
docs_by_gen = [
- ((self.make_document, ('doc-id', 'replica:1', tests.simple_doc,), {}),
+ ((self.make_document,
+ ('doc-id', 'replica:1', tests.simple_doc,), {}),
10, 'T-sid')]
new_gen, trans_id = yield self.st.sync_exchange(
docs_by_gen, 'replica', last_known_generation=0,
@@ -519,7 +520,8 @@ class SoledadDatabaseSyncTargetTests(
doc = self.db.create_doc_from_json('{}')
edit_rev = 'replica:1|' + doc.rev
docs_by_gen = [
- ((self.make_document, (doc.doc_id, edit_rev, None), {}), 10, 'T-sid')]
+ ((self.make_document, (doc.doc_id, edit_rev, None), {}),
+ 10, 'T-sid')]
new_gen, trans_id = yield self.st.sync_exchange(
docs_by_gen, 'replica', last_known_generation=0,
last_known_trans_id=None, insert_doc_cb=self.receive_doc)
@@ -662,8 +664,8 @@ class SoledadDatabaseSyncTargetTests(
doc = self.db.create_doc_from_json(tests.simple_doc)
docs_by_gen = [
((self.make_document, ('new', 'other:1', '{}'), {}), 4, 'T-foo'),
- ((self.make_document, (doc.doc_id, doc.rev, doc.get_json()), {}), 5,
- 'T-bar')]
+ ((self.make_document, (doc.doc_id, doc.rev, doc.get_json()), {}),
+ 5, 'T-bar')]
new_gen, _ = yield self.st.sync_exchange(
docs_by_gen, 'other-replica', last_known_generation=0,
last_known_trans_id=None, insert_doc_cb=self.receive_doc)
@@ -746,6 +748,7 @@ class SoledadDatabaseSyncTargetTests(
yield self.st.record_sync_info('replica', 0, 'T-sid')
self.assertEqual(expected, called)
+
WAIT_STEP = 1
MAX_WAIT = 10
DBPASS = "pass"