예제 #1
0
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
예제 #2
0
 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 = {}
예제 #3
0
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
예제 #4
0
 def setUp(self):
     couchquery.createdb(testdb_url)
     self.testdb = Database(testdb_url)
     self.testdb.sync_design_doc("logcompare", logcompare.design_doc)
예제 #5
0
 def setUp(self):
     couchquery.createdb(testdb_url)
     self.testdb = Database(testdb_url)
     self.testdb.sync_design_doc("logcompare", logcompare.design_doc)