cloudant-labs / cloudant-python

Asynchronous Cloudant / CouchDB interface for Python
http://cloudant-labs.github.io/cloudant-python/
37 stars 17 forks source link

27 merge raise for status #28

Closed ksnavely closed 10 years ago

ksnavely commented 10 years ago

See here. We've guarded against 404s however couchdb/cloudant will return error JSON for other statuses as well.

This adds a raise_for_status call to the merge function, so an an Exception is raised rather than inadvertently merging error JSON with a document.

I popped into test/ to see if I couldn't cover the error case, but looks like it would behoove us to pull out the tests into individual test modules and toss in a mocking harness to use when ideal. I didn't want to throw a ton of changes into this PR, so take a look and perhaps we can beef up the test suite a bit later.

garbados commented 10 years ago

LGTM; waiting on Travis and coveralls.

coveralls commented 10 years ago

Coverage Status

Changes Unknown when pulling 4ba2a0ce5f83124b4fa21b857117026f2e30c3ee on ksnavely:27-merge-raise-for-status into \ on cloudant-labs:master**.