Add more debug information for JSONResponseHandler

When the expected value doesn't match the received
for the JSONResponseHandler, this change adds the received
value into the assertion error message.
This commit is contained in:
Mehdi Abaakouk 2015-08-05 11:54:14 +02:00
parent 8a97c3d456
commit 73e284cc63

View File

@ -106,8 +106,8 @@ class JSONResponseHandler(ResponseHandler):
raise AssertionError('json path %s cannot match %s' %
(path, test.json_data))
expected = test.replace_template(value)
test.assertEqual(expected, match, 'Unable to match %s as %s'
% (path, expected))
test.assertEqual(expected, match, 'Unable to match %s as %s, got %s'
% (path, expected, match))
class HeadersResponseHandler(ResponseHandler):