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
I can provide a PR, but there are different ways to tackle this:
I would prefer to avoid adding additional dependencies. If we wanted to provide a 'diff' we could print out the mismatching sections of the tree and the path we're currently comparing 🤷
Describe the bug
The implementation of
json_params_matcher
does not support arbitrarily nested JSON objects, such as lists of dicts.It says so in the signature:
def json_params_matcher(params: Optional[Dict[str, Any]]) -> Callable[..., Any]:
and the simple check of
params_dict == json_body
is not enough. Additionally, an Exception is raised in this section, as a dict is expected.if not valid: reason = "request.body doesn't match: {} doesn't match {}".format( _create_key_val_str(json_body), _create_key_val_str(params_dict) )
Additional context
I can provide a PR, but there are different ways to tackle this:
As this might entail additional dependencies, I'd like to get your opinion on this before submitting a PR.
Version of
responses
0.21.0
Steps to Reproduce
Expected Result
result
should be (False, ""), no error is thrownActual Result
AttributeError is raised: 'list' object has no attribute 'keys'
The text was updated successfully, but these errors were encountered: