def setupdb(): db = Database("http://localhost:5984/test_pythonviews") try: deletedb(db) except: pass createdb(db) db.sync_design_doc("pythonView", os.path.join(this_directory, "design"), language="python") db.sync_design_doc("javascriptView", os.path.join(this_directory, "design"), language="javascript") return db
def __init__(self, uri, flag='c', writeback=False, raiseconflicts=False, http_cache=None): self._db = couchquery.Database(uri, cache=http_cache) if flag == 'n': couchquery.deletedb(self._db) if flag in ('n', 'c'): if not self._db.exists(): couchquery.createdb(self._db) self._flag = flag self._writeback = writeback self._raiseconflicts = raiseconflicts self._cache = {}
def setup_module(module): db = Database('http://localhost:5984/test_testbot') createdb(db) sync(db) application = TestBotApplication(db, MozillaManager()) httpd = make_server('', 8888, application) print "Serving on http://localhost:8888/" thread = Thread(target=httpd.serve_forever) thread.start() sleep(1) module.thread = thread module.httpd = httpd module.db = db
def setUp(self): couchquery.createdb(testdb_url) self.testdb = Database(testdb_url) self.testdb.sync_design_doc("logcompare", logcompare.design_doc)