def initiate(self): self.configure() self.prepare_workspace() self.command = base.which('couchdb', os.environ['PATH']) self.env = copy.deepcopy(os.environ) self.args = ['-a', self.config['local_ini']] self.keep_workdir = False
def configure(self): self.config = dict() workspace = self.get_tmp_dir() self.config['workspace'] = workspace self.config['tempdir'] = os.path.join(workspace, 'couch_db') self.config['port'] = self.get_free_port() self.config['log'] = os.path.join(workspace, 'couch_test.log') self.config['local_ini'] = os.path.join(workspace, 'local.ini') self.config['host'] = '127.0.0.1' couchpy = base.which('feat-couchpy', os.environ['PATH']) if not couchpy: # workaround to work with tests (when we don't have bin in path) import feat bin_path = os.path.abspath(os.path.join( feat.__path__[0], '..', '..', 'bin')) couchpy = base.which('feat-couchpy', bin_path) if couchpy is None: raise base.DependencyError( 'feat-couchpy script is not in a path') self.config['couchpy'] = couchpy