def add_wiki_and_close(sock, count=200, dbclass=zerodb.DB): db = zerodb.testing.db(None, sock, dbclass=dbclass) with transaction.manager: for doc in wiki.read_docs(join(dirname(abspath(__file__)), "wiki_sample")): p = WikiPage(**doc) db.add(p) db.disconnect()
def add_wiki_and_close(sock, count=200, dbclass=zerodb.DB): db = dbclass(sock, username="******", password=TEST_PASSPHRASE, debug=True) with transaction.manager: for doc in wiki.read_docs(join(dirname(abspath(__file__)), "wiki_sample")): p = WikiPage(**doc) db.add(p) db.disconnect()
def add_wiki_and_close(sock, count=200, dbclass=zerodb.DB): db = zerodb.testing.db(None, sock, dbclass=dbclass) with transaction.manager: for doc in wiki.read_docs( join(dirname(abspath(__file__)), "wiki_sample")): p = WikiPage(**doc) db.add(p) db.disconnect()