summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2016-09-22 03:08:20 -0400
committerdrebs <drebs@leap.se>2016-12-12 09:11:59 -0200
commit69958161af00958b1d92ab6153a591aa89199e35 (patch)
treeb43f3724dfe0915d462484050d21ea7d2995c75e
parente7bf2bcf974b27d1a52f08e45ad35635226ffa92 (diff)
[refactor] remove lingering refs to syncdb
-rw-r--r--testing/test_soledad/util.py7
-rw-r--r--testing/tests/sync/test_sqlcipher_sync.py6
-rw-r--r--testing/tests/sync/test_sync_deferred.py10
-rw-r--r--testing/tests/sync/test_sync_target.py19
4 files changed, 9 insertions, 33 deletions
diff --git a/testing/test_soledad/util.py b/testing/test_soledad/util.py
index bde0b1b7..b1965aa6 100644
--- a/testing/test_soledad/util.py
+++ b/testing/test_soledad/util.py
@@ -190,8 +190,7 @@ class MockedSharedDBTest(object):
def soledad_sync_target(
- test, path, source_replica_uid=uuid4().hex,
- sync_db=None, sync_enc_pool=None):
+ test, path, source_replica_uid=uuid4().hex):
creds = {'token': {
'uuid': 'user-uuid',
'token': 'auth-token',
@@ -201,9 +200,7 @@ def soledad_sync_target(
source_replica_uid,
creds,
test._soledad._crypto,
- None, # cert_file
- sync_db=sync_db,
- sync_enc_pool=sync_enc_pool)
+ None) # cert_file
# redefine the base leap test class so it inherits from twisted trial's
diff --git a/testing/tests/sync/test_sqlcipher_sync.py b/testing/tests/sync/test_sqlcipher_sync.py
index 2528600d..c3cd8444 100644
--- a/testing/tests/sync/test_sqlcipher_sync.py
+++ b/testing/tests/sync/test_sqlcipher_sync.py
@@ -709,13 +709,9 @@ def make_local_db_and_soledad_target(
test.startTwistedServer()
replica_uid = os.path.basename(path)
db = test.request_state._create_database(replica_uid)
- sync_db = test._soledad._sync_db
- sync_enc_pool = test._soledad._sync_enc_pool
st = soledad_sync_target(
test, db._dbname,
- source_replica_uid=source_replica_uid,
- sync_db=sync_db,
- sync_enc_pool=sync_enc_pool)
+ source_replica_uid=source_replica_uid)
return db, st
target_scenarios = [
diff --git a/testing/tests/sync/test_sync_deferred.py b/testing/tests/sync/test_sync_deferred.py
index 482b150c..eb71ea73 100644
--- a/testing/tests/sync/test_sync_deferred.py
+++ b/testing/tests/sync/test_sync_deferred.py
@@ -71,12 +71,10 @@ class BaseSoledadDeferredEncTest(SoledadWithCouchServerMixin):
import binascii
tohex = binascii.b2a_hex
key = tohex(self._soledad.secrets.get_local_storage_key())
- sync_db_key = tohex(self._soledad.secrets.get_sync_db_key())
dbpath = self._soledad._local_db_path
self.opts = SQLCipherOptions(
- dbpath, key, is_raw_key=True, create=False,
- defer_encryption=True, sync_db_key=sync_db_key)
+ dbpath, key, is_raw_key=True, create=False)
self.db1 = SQLCipherDatabase(self.opts)
self.db2 = self.request_state._create_database('test')
@@ -139,15 +137,11 @@ class TestSoledadDbSyncDeferredEncDecr(
and Token auth.
"""
replica_uid = self._soledad._dbpool.replica_uid
- sync_db = self._soledad._sync_db
- sync_enc_pool = self._soledad._sync_enc_pool
dbsyncer = self._soledad._dbsyncer # Soledad.sync uses the dbsyncer
target = soledad_sync_target(
self, self.db2._dbname,
- source_replica_uid=replica_uid,
- sync_db=sync_db,
- sync_enc_pool=sync_enc_pool)
+ source_replica_uid=replica_uid)
self.addCleanup(target.close)
return sync.SoledadSynchronizer(
dbsyncer,
diff --git a/testing/tests/sync/test_sync_target.py b/testing/tests/sync/test_sync_target.py
index 997dcdcd..b301c48b 100644
--- a/testing/tests/sync/test_sync_target.py
+++ b/testing/tests/sync/test_sync_target.py
@@ -130,13 +130,9 @@ def make_local_db_and_soledad_target(
test.startTwistedServer()
replica_uid = os.path.basename(path)
db = test.request_state._create_database(replica_uid)
- sync_db = test._soledad._sync_db
- sync_enc_pool = test._soledad._sync_enc_pool
st = soledad_sync_target(
test, db._dbname,
- source_replica_uid=source_replica_uid,
- sync_db=sync_db,
- sync_enc_pool=sync_enc_pool)
+ source_replica_uid=source_replica_uid)
return db, st
@@ -167,15 +163,11 @@ class TestSoledadSyncTarget(
def getSyncTarget(self, path=None, source_replica_uid=uuid4().hex):
if self.port is None:
self.startTwistedServer()
- sync_db = self._soledad._sync_db
- sync_enc_pool = self._soledad._sync_enc_pool
if path is None:
path = self.db2._dbname
target = self.sync_target(
self, path,
- source_replica_uid=source_replica_uid,
- sync_db=sync_db,
- sync_enc_pool=sync_enc_pool)
+ source_replica_uid=source_replica_uid)
self.addCleanup(target.close)
return target
@@ -811,12 +803,10 @@ class TestSoledadDbSync(
import binascii
tohex = binascii.b2a_hex
key = tohex(self._soledad.secrets.get_local_storage_key())
- sync_db_key = tohex(self._soledad.secrets.get_sync_db_key())
dbpath = self._soledad._local_db_path
self.opts = SQLCipherOptions(
- dbpath, key, is_raw_key=True, create=False,
- defer_encryption=True, sync_db_key=sync_db_key)
+ dbpath, key, is_raw_key=True, create=False)
self.db1 = SQLCipherDatabase(self.opts)
self.db2 = self.request_state._create_database(replica_uid='test')
@@ -855,8 +845,7 @@ class TestSoledadDbSync(
self.opts,
crypto,
replica_uid,
- None,
- defer_encryption=True)
+ None)
self.dbsyncer = dbsyncer
return dbsyncer.sync(target_url,
creds=creds)