From eb413f5373af70cbd41a0f9bf0800cf47d609dcc Mon Sep 17 00:00:00 2001 From: Peter Hamilton Date: Mon, 12 Aug 2013 09:05:44 -0400 Subject: [PATCH] Fixing malformed assert message formatting This modification addresses Bug #1210296, specifically addressing malformed assert message formatting in assert_called_anytime. When verifying that an API method was called during test execution, the assert statement used will throw a TypeError when formatting the assert message, instead of the expected AssertionError. This occurs because a nested tuple in the format list is not properly expanded. The error itself likely exists because assert_called_anytime is not currently used in the python-cinderclient testing framework. The fix involves joining the arguments in the format list into a single tuple, allowing proper argument expansion. Fixes: bug 1210296 Change-Id: I6cf9dd55cff318e8a850637c540436c91dac08df --- cinderclient/tests/fakes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinderclient/tests/fakes.py b/cinderclient/tests/fakes.py index 29260e1c7..41996a9ec 100644 --- a/cinderclient/tests/fakes.py +++ b/cinderclient/tests/fakes.py @@ -67,7 +67,7 @@ class FakeClient(object): break assert found, 'Expected %s %s; got %s' % ( - expected, self.client.callstack) + expected + (self.client.callstack, )) if body is not None: try: