cdent / gabbi

Declarative HTTP Testing for Python and anything else
http://gabbi.readthedocs.org/
Other
148 stars 34 forks source link

Add 'disable_response_handler' test data #301

Closed cdent closed 2 years ago

cdent commented 2 years ago

Defaults to False. If true, no response handler is run to transform the response body from its raw content-type to structured data that can be used by tests managed by that content-type's handler.

This is useful when a response (over which we probably have no control) claims a content-type of application/json but the response is not valid JSON. In this circumstance there will be an error, the test will fail.

Sometimes we may need the test to not fail so we can make other checks (such as checking headers) without worrying about the body. In that case disable_response_handler may be set to True.

In the failure case, when we do want the error, the error is now more informative.

Docs are updated to reflect the new field.

Also included in this change:

Fixes #299