summaryrefslogtreecommitdiff
path: root/testing/tests/perf
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2016-08-19 17:06:25 -0300
committerVictor Shyba <victor.shyba@gmail.com>2016-08-22 12:36:16 -0300
commit8e3d85950bb54b7818f0356387bba81769787f13 (patch)
tree6d6c1ccc4b7781943d107c05c78d5d936c224f0b /testing/tests/perf
parent6f5bc4d7301147c35a9651cf423804c6de252647 (diff)
[test] remove fixed default uuid
Use a new one to avoid reusing the same database.
Diffstat (limited to 'testing/tests/perf')
-rw-r--r--testing/tests/perf/conftest.py17
1 files changed, 11 insertions, 6 deletions
diff --git a/testing/tests/perf/conftest.py b/testing/tests/perf/conftest.py
index 0b66263a..fca9c58d 100644
--- a/testing/tests/perf/conftest.py
+++ b/testing/tests/perf/conftest.py
@@ -35,7 +35,6 @@ def pytest_addoption(parser):
# default options for all tests
#
-DEFAULT_UUID = '0'
DEFAULT_PASSPHRASE = '123'
DEFAULT_URL = 'http://127.0.0.1:2424'
@@ -84,7 +83,7 @@ class SoledadDatabases(object):
def soledad_dbs(request):
couch_url = request.config.option.couch_url
- def create(uuid=DEFAULT_UUID):
+ def create(uuid):
db = SoledadDatabases(couch_url)
request.addfinalizer(db.teardown)
return db.setup(uuid)
@@ -113,7 +112,7 @@ class UserDatabase(object):
def remote_db(request):
couch_url = request.config.option.couch_url
- def create(uuid=DEFAULT_UUID):
+ def create(uuid):
db = UserDatabase(couch_url, uuid)
request.addfinalizer(db.teardown)
return db.setup()
@@ -212,14 +211,20 @@ def soledad_client(tmpdir, soledad_server, remote_db, soledad_dbs, request):
passphrase = DEFAULT_PASSPHRASE
server_url = DEFAULT_URL
token = DEFAULT_TOKEN
+ default_uuid = uuid4().hex
+ remote_db(default_uuid)
+ soledad_dbs(default_uuid)
# get a soledad instance
def create(new=False):
- uuid = uuid4().hex if new else DEFAULT_UUID
secrets_path = os.path.join(tmpdir.strpath, '%s.secret' % uuid4().hex)
local_db_path = os.path.join(tmpdir.strpath, '%s.db' % uuid4().hex)
- remote_db(uuid)
- soledad_dbs(uuid)
+ if new:
+ uuid = uuid4().hex
+ remote_db(uuid)
+ soledad_dbs(uuid)
+ else:
+ uuid = default_uuid
soledad_client = Soledad(
uuid,
unicode(passphrase),