summaryrefslogtreecommitdiff
path: root/common/src/leap/soledad/common/tests/util.py
diff options
context:
space:
mode:
authorVictor Shyba <victor.shyba@gmail.com>2015-10-13 21:34:40 -0300
committerVictor Shyba <victor.shyba@gmail.com>2015-11-03 12:38:59 -0300
commitf0b96af943dcb6c8cde4f6d4280186d78c78096c (patch)
treeefe7b8876b786d99684f003ee475994e9051a4c2 /common/src/leap/soledad/common/tests/util.py
parentb0557f9c1d5e6f153f926ba3cb5876453ef23a10 (diff)
[refactor] split out backend from couch database
First step of splitting classes across files on common. backend.py holds SoledadBackend (generic backend logic) couch/ is now a directory with old code inside __init__.py and CouchServerState on state.py Also removed mock IndexedSoledadBackend, since Soledad does not support indexing due to encryption on server side. Also fixed DesignDocUnknownError to show up what is the message of the original exception. It was being lost.
Diffstat (limited to 'common/src/leap/soledad/common/tests/util.py')
-rw-r--r--common/src/leap/soledad/common/tests/util.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/common/src/leap/soledad/common/tests/util.py b/common/src/leap/soledad/common/tests/util.py
index bfd06856..f7f9ebd0 100644
--- a/common/src/leap/soledad/common/tests/util.py
+++ b/common/src/leap/soledad/common/tests/util.py
@@ -27,7 +27,6 @@ import shutil
import random
import string
import u1db
-import traceback
import couchdb
from uuid import uuid4
@@ -37,17 +36,17 @@ from StringIO import StringIO
from pysqlcipher import dbapi2
from u1db import sync
-from u1db.errors import DatabaseDoesNotExist
from u1db.remote import http_database
from twisted.trial import unittest
-from leap.common.files import mkdir_p
from leap.common.testing.basetest import BaseLeapTest
from leap.soledad.common import soledad_assert
from leap.soledad.common.document import SoledadDocument
-from leap.soledad.common.couch import SoledadBackend, CouchServerState
+from leap.soledad.common.couch import CouchDatabase
+from leap.soledad.common.couch.state import CouchServerState
+
from leap.soledad.common.crypto import ENC_SCHEME_KEY
from leap.soledad.client import Soledad
@@ -379,7 +378,7 @@ class CouchServerStateForTests(CouchServerState):
Create db and append to a list, allowing test to close it later
"""
dbname = dbname or ('test-%s' % uuid4().hex)
- db = SoledadBackend.open_database(
+ db = CouchDatabase.open_database(
urljoin(self.couch_url, dbname),
True,
replica_uid=replica_uid or 'test',