summaryrefslogtreecommitdiff
path: root/testing/tests/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tests/conftest.py')
-rw-r--r--testing/tests/conftest.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/testing/tests/conftest.py b/testing/tests/conftest.py
index 1d3125d5..49cc35f6 100644
--- a/testing/tests/conftest.py
+++ b/testing/tests/conftest.py
@@ -191,9 +191,19 @@ def soledad_client(tmpdir, soledad_server, remote_db, soledad_dbs, request):
soledad_dbs(default_uuid)
# get a soledad instance
- def create():
- secrets_path = os.path.join(tmpdir.strpath, '%s.secret' % default_uuid)
- local_db_path = os.path.join(tmpdir.strpath, '%s.db' % default_uuid)
+ def create(force_fresh_db=False):
+ secrets_file = '%s.secret' % default_uuid
+ secrets_path = os.path.join(tmpdir.strpath, secrets_file)
+
+ # in some tests we might want to use the same user and remote database
+ # but with a clean/empty local database (i.e. download benchmarks), so
+ # here we provide a way to do that.
+ db_file = '%s.db' % default_uuid
+ if force_fresh_db:
+ prefix = uuid4().hex
+ db_file = prefix + '-' + db_file
+ local_db_path = os.path.join(tmpdir.strpath, db_file)
+
soledad_client = Soledad(
default_uuid,
unicode(passphrase),