saymedia/remoteobjects — pull request #13 by carljm (2011-12-03 05:58:26+00:00)
Title: Correctly handle success-but-no-content responses

There are several success response codes that are listed as False in HttpObject.response_has_content: 202 Accepted and 204 No Content. Currently HttpObject.update_from_response does not respect response_has_content, and so if it actually receives a non-error response without body content, it results in a ValueError "No JSON object could be decoded."

These changes add a test for that case, and fix it, by simply not trying to update data from a response that is not expected to contain content.