Check headers in response before Strings and JSON

This helps avoid a situation where:

* no content-type header is returned
* but json is expected by a response_json_paths
* and no json_data is created because that will only happen if there
  is a correct content-type

This will at least make sure that the initial error is the one
reported, rather than something caused by that error.

It also makes semantic sense, the order of testing is:

* check the status
* check the headers
* check the body
This commit is contained in:
Chris Dent
2015-07-23 12:13:24 +01:00
parent de4cef8da1
commit d83d0acb8a

View File

@@ -40,9 +40,9 @@ from gabbi import suite as gabbi_suite
from gabbi import utils
RESPONSE_HANDLERS = [
handlers.HeadersResponseHandler,
handlers.StringResponseHandler,
handlers.JSONResponseHandler,
handlers.HeadersResponseHandler,
]