From 371831ae7d1e8c6377d17b9ab8e3ae37e09366bb Mon Sep 17 00:00:00 2001 From: Eric Harney Date: Fri, 24 Mar 2017 14:04:32 -0400 Subject: [PATCH] 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 --- cinderclient/tests/unit/fakes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cinderclient/tests/unit/fakes.py b/cinderclient/tests/unit/fakes.py index b4bcafc14..2b7d190a3 100644 --- a/cinderclient/tests/unit/fakes.py +++ b/cinderclient/tests/unit/fakes.py @@ -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: