Tests: Add info to assert_called failure message

This provides enough info to understand why this assertion
is failing without having to attach a debugger.

Change-Id: Ib042039d7589e7c86502ac15773fce995ff64bb9
This commit is contained in:
Eric Harney 2017-03-24 14:04:32 -04:00
parent 29d29a7cd4
commit 371831ae7d
1 changed files with 4 additions and 1 deletions

View File

@ -66,7 +66,10 @@ class FakeClient(object):
expected + called)
if body is not None:
assert self.client.callstack[pos][2] == body
actual_body = self.client.callstack[pos][2]
assert actual_body == body, ("body mismatch. expected:\n" +
str(body) + "\n" +
"actual:\n" + str(actual_body))
if partial_body is not None:
try: