Skip to content

Instantly share code, notes, and snippets.

@nailor
Created February 19, 2011 08:37
Show Gist options
  • Save nailor/834928 to your computer and use it in GitHub Desktop.
Save nailor/834928 to your computer and use it in GitHub Desktop.
Test for issue #10 in Trombi
import trombi
from tornado.ioloop import IOLoop
ioloop = IOLoop.instance()
f = open('onemb.zero')
db = trombi.from_uri('http://localhost:5984/test')
def doc_created(doc):
assert not doc.error
doc.attach('1M', f.read(), attach_done)
def attach_done(doc):
assert not doc.error
ioloop.stop()
db.set({'test': 'doc'}, doc_created)
ioloop.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment