Skip to content

Commit 3d145de

Browse files
committed
Improve logging of failed assert_called_with assertions
1 parent d13d201 commit 3d145de

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

SoftLayer/testing/__init__.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,16 @@ def run_command(self,
148148
def call_has_props(call, props):
149149
"""Check if a call has matching properties of a given props dictionary."""
150150

151-
for prop, value in props.items():
152-
call_value = getattr(call, prop)
153-
if call_value != value:
154-
logging.info('%s::%s property mismatch(%s): %r != %r',
155-
call.service,
156-
call.method,
157-
prop,
158-
value,
159-
call_value)
151+
for prop, expected_value in props.items():
152+
actual_value = getattr(call, prop)
153+
if actual_value != expected_value:
154+
logging.info(
155+
'%s::%s property mismatch, %s: expected=%r; actual=%r',
156+
call.service,
157+
call.method,
158+
prop,
159+
expected_value,
160+
actual_value)
160161
return False
161162

162163
return True

0 commit comments

Comments
 (0)