Comment 2 for bug 694909

Revision history for this message
Jason Gerard DeRose (jderose) wrote :

Thanks for stopping by #novacut, mandel! And extra thanks for offering to promptly code up a solution!

For reference, here is the base test class I'm using to do the desktopcouch setup. This is only a slight modification of what Chad setup for me:

class CouchCase(TestCase):
    """
    Base class for tests that need a desktopcouch testing Context.
    """

    def setUp(self):
        self.home = TempHome()
        self.couchdir = tempfile.mkdtemp(prefix='dc-test.')
        self.ctx = dc_context(self.couchdir)

    def tearDown(self):
        stop_couchdb(ctx=self.ctx)
        self.ctx = None
        shutil.rmtree(self.couchdir)
        self.couchdir = None
        self.home = None

The dc_context() function is the same from the above comment.