コード例 #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
ファイル: shelve.py プロジェクト: dichoda/couchquery
 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
ファイル: __init__.py プロジェクト: ctalbert/testbot
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)