You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
======================================================================
ERROR: test_request (gabbi.driver.test_env_loader_env_notes_delete_environment_note)
gabbi.driver.test_env_loader_env_notes_delete_environment_note.test_request
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
File "/Library/Python/2.7/site-packages/gabbi/case.py", line 78, in wrapper
func(self)
File "/Library/Python/2.7/site-packages/gabbi/case.py", line 118, in test_request
self._run_test()
File "/Library/Python/2.7/site-packages/gabbi/case.py", line 312, in _run_test
self._run_request(full_url, method, headers, body)
File "/Library/Python/2.7/site-packages/gabbi/case.py", line 279, in _run_request
self.json_data = json.loads(decoded_output)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/__init__.py", line 338, in loads
return _default_decoder.decode(s)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 365, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/json/decoder.py", line 383, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
defaults:
request_headers:
accept: application/jsoncontent-type: application/jsonresponse_headers:
content-type: application/jsontests:
- name: delete environment noteverbose: Truemethod: DELETE# Use previous $RESPONSE to get note IDurl: /v2/notes/$RESPONSE['$.id']status: 302 || 200
The text was updated successfully, but these errors were encountered:
kiminoa
changed the title
Special case? ValueError: No JSON object could be decoded for JSON response with an empty body
Special case? ValueError: "No JSON object could be decoded" for JSON response with an empty body
Jun 10, 2015
My workaround was to nix the default headers' content-type and individually specify them for each test. This specific test wanted a javascript response, but test-specific headers didn't override the default. I'll file a separate issue for that for consideration.
I don't know if there's a use case where an empty JSON body could happen where this is still a bug, but in our case, the DELETE issues a javascript response my default.
Note that this error can only happen if there was something other than an empty string in the body of your response because of this line which basically says "only decode the body if there is a body and the content type says 'json'".
So it seems there's something weird going on with the body of your response?
Response body: empty
Response headers:
The text was updated successfully, but these errors were encountered: