From af456e5640d65fd500e6685527d199a001e4a89c Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Tue, 20 Aug 2013 15:52:20 +0200 Subject: fixes so we can execute some tests on its own --- soledad/src/leap/soledad/tests/u1db_tests/__init__.py | 7 +++++-- soledad/src/leap/soledad/tests/u1db_tests/test_sync.py | 6 +++++- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'soledad') diff --git a/soledad/src/leap/soledad/tests/u1db_tests/__init__.py b/soledad/src/leap/soledad/tests/u1db_tests/__init__.py index 43304b43..3bc12487 100644 --- a/soledad/src/leap/soledad/tests/u1db_tests/__init__.py +++ b/soledad/src/leap/soledad/tests/u1db_tests/__init__.py @@ -189,8 +189,11 @@ class DatabaseBaseTests(TestCase): scenarios = LOCAL_DATABASES_SCENARIOS - def create_database(self, replica_uid): - return self.make_database_for_test(self, replica_uid) + def make_database_for_test(self, replica_uid): + return make_memory_database_for_test(self, replica_uid) + + def create_database(self, *args): + return self.make_database_for_test(self, *args) def copy_database(self, db): # DO NOT COPY OR REUSE THIS CODE OUTSIDE TESTS: COPYING U1DB DATABASES diff --git a/soledad/src/leap/soledad/tests/u1db_tests/test_sync.py b/soledad/src/leap/soledad/tests/u1db_tests/test_sync.py index 96aa2736..a87c1787 100644 --- a/soledad/src/leap/soledad/tests/u1db_tests/test_sync.py +++ b/soledad/src/leap/soledad/tests/u1db_tests/test_sync.py @@ -85,7 +85,8 @@ class DatabaseSyncTargetTests(tests.DatabaseBaseTests, whitebox = True def setUp(self): - super(DatabaseSyncTargetTests, self).setUp() + tests.DatabaseBaseTests.setUp(self) + tests.TestCaseWithServer.setUp(self) self.db, self.st = self.create_db_and_target(self) self.other_changes = [] @@ -96,6 +97,9 @@ class DatabaseSyncTargetTests(tests.DatabaseBaseTests, del self.db super(DatabaseSyncTargetTests, self).tearDown() + def create_db_and_target(self, *args): + return _make_local_db_and_target(*args) + def receive_doc(self, doc, gen, trans_id): self.other_changes.append( (doc.doc_id, doc.rev, doc.get_json(), gen, trans_id)) -- cgit v1.2.3