summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authordrebs <drebs@leap.se>2013-01-10 13:18:48 -0200
committerdrebs <drebs@leap.se>2013-01-10 13:18:48 -0200
commitea6c9852349b9b4894c00967bd2f7b7b7d287136 (patch)
tree85a16b1bb12b4ca7ef83b8f1aa8900da270ce0dc /tests
parent8e32fdb0be5d34c6554a8c0f75bdf8bf0debcd4a (diff)
CouchDatabase passes all relevant u1db tests.
Diffstat (limited to 'tests')
-rw-r--r--tests/test_couch.py62
-rw-r--r--tests/test_logs.py3
2 files changed, 35 insertions, 30 deletions
diff --git a/tests/test_couch.py b/tests/test_couch.py
index 3f6c45f6..2337be9b 100644
--- a/tests/test_couch.py
+++ b/tests/test_couch.py
@@ -40,7 +40,7 @@ class TestCouchBackendImpl(tests.TestCase):
# The following tests come from `u1db.tests.test_backends`.
#-----------------------------------------------------------------------------
-def make_couch_database_for_test(test, replica_uid, path='test'):
+def make_couch_database_for_test(test, replica_uid):
return couch.CouchDatabase('http://localhost:5984', 'u1db_tests',
replica_uid=replica_uid)
@@ -81,40 +81,44 @@ class CouchDatabaseTests(LocalDatabaseTests):
super(CouchDatabaseTests, self).tearDown()
-#class CouchValidateGenNTransIdTests(LocalDatabaseValidateGenNTransIdTests):
-#
-# scenarios = COUCH_SCENARIOS
-#
-# def tearDown(self):
-# self.db.delete_database()
-# super(CouchTests, self).tearDown()
-#
-#
-#class CouchValidateSourceGenTests(LocalDatabaseValidateSourceGenTests):
-#
-# scenarios = COUCH_SCENARIOS
-#
-# def tearDown(self):
-# self.db.delete_database()
-# super(CouchTests, self).tearDown()
-#
-#
-#class CouchWithConflictsTests(LocalDatabaseWithConflictsTests):
-#
-# scenarios = COUCH_SCENARIOS
-#
-# def tearDown(self):
-# self.db.delete_database()
-# super(CouchTests, self).tearDown()
-#
-#
+class CouchValidateGenNTransIdTests(LocalDatabaseValidateGenNTransIdTests):
+
+ scenarios = COUCH_SCENARIOS
+
+ def tearDown(self):
+ self.db.delete_database()
+ super(CouchValidateGenNTransIdTests, self).tearDown()
+
+
+class CouchValidateSourceGenTests(LocalDatabaseValidateSourceGenTests):
+
+ scenarios = COUCH_SCENARIOS
+
+ def tearDown(self):
+ self.db.delete_database()
+ super(CouchValidateSourceGenTests, self).tearDown()
+
+
+class CouchWithConflictsTests(LocalDatabaseWithConflictsTests):
+
+ scenarios = COUCH_SCENARIOS
+
+ def tearDown(self):
+ self.db.delete_database()
+ super(CouchWithConflictsTests, self).tearDown()
+
+
+# Notice: the CouchDB backend is currently used for storing encrypted data in
+# the server, so indexing makes no sense. Thus, we ignore index testing for
+# now.
+
#class CouchIndexTests(DatabaseIndexTests):
#
# scenarios = COUCH_SCENARIOS
#
# def tearDown(self):
# self.db.delete_database()
-# super(CouchTests, self).tearDown()
+# super(CouchIndexTests, self).tearDown()
#
load_tests = tests.load_with_scenarios
diff --git a/tests/test_logs.py b/tests/test_logs.py
index 7fbb1cb7..2102b671 100644
--- a/tests/test_logs.py
+++ b/tests/test_logs.py
@@ -69,10 +69,11 @@ class LogTestCase(unittest.TestCase):
'error getting whats changed.')
def test_conflict_log(self):
+ # TODO: include tests for `get_conflicts` and `has_conflicts`.
data = [('1', 'my:1', 'irrelevant'),
('2', 'my:1', 'irrelevant'),
('3', 'my:1', 'irrelevant')]
- log = ConflictLog()
+ log = ConflictLog(None)
log.log = data
log.delete_conflicts([('1','my:1'),('2','my:1')])
self.assertEqual(