Skip to content

Commit

Permalink
Fixing malformed assert message formatting
Browse files Browse the repository at this point in the history
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
  • Loading branch information
PeterHamilton committed Aug 13, 2013
1 parent 2ba74ec commit eb413f5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cinderclient/tests/fakes.py
Expand Up @@ -67,7 +67,7 @@ def assert_called_anytime(self, method, url, body=None):
break

assert found, 'Expected %s %s; got %s' % (
expected, self.client.callstack)
expected + (self.client.callstack, ))

if body is not None:
try:
Expand Down

0 comments on commit eb413f5

Please sign in to comment.