diff options
author | drebs <drebs@leap.se> | 2013-02-13 12:45:53 -0200 |
---|---|---|
committer | drebs <drebs@leap.se> | 2013-02-13 12:45:53 -0200 |
commit | ecf568431319b4e81bc077141048d0b7f1e0964d (patch) | |
tree | c3b2fe3e6aea128ec8fc2630547bfc5077d36d23 /tests/test_couch.py | |
parent | b056db0ad84af10d3d6368ea3e93f23f0f3251a9 (diff) |
Refactor and fix tests.
Diffstat (limited to 'tests/test_couch.py')
-rw-r--r-- | tests/test_couch.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/test_couch.py b/tests/test_couch.py index b07d1a98..c02d485b 100644 --- a/tests/test_couch.py +++ b/tests/test_couch.py @@ -38,6 +38,9 @@ class CouchDBWrapper(object): """ def start(self): + """ + Start a CouchDB instance for a test. + """ self.tempdir = tempfile.mkdtemp(suffix='.couch.test') path = os.path.join(os.path.dirname(__file__), @@ -89,6 +92,9 @@ stderr: self.port = int(m.group('port')) def stop(self): + """ + Terminate the CouchDB instance. + """ self.process.terminate() self.process.communicate() os.system("rm -rf %s" % self.tempdir) @@ -100,12 +106,18 @@ class CouchDBTestCase(unittest.TestCase): """ def setUp(self): + """ + Make sure we have a CouchDB instance for a test. + """ self.wrapper = CouchDBWrapper() self.wrapper.start() #self.db = self.wrapper.db super(CouchDBTestCase, self).setUp() def tearDown(self): + """ + Stop CouchDB instance for test. + """ self.wrapper.stop() super(CouchDBTestCase, self).tearDown() @@ -148,7 +160,7 @@ def copy_couch_database_for_test(test, db): new_db._conflicts = copy.deepcopy(db._conflicts) new_db._other_generations = copy.deepcopy(db._other_generations) new_db._indexes = copy.deepcopy(db._indexes) - new_db._set_u1db_data() + new_db._store_u1db_data() return new_db |