derwiki-adroll / mock

Automatically exported from code.google.com/p/mock
BSD 2-Clause "Simplified" License
0 stars 0 forks source link

call_args_list has three-tuple members whereas before they had two-tuple members #107

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In 0.8 beta 1 the entries in call_args_list all have three members, whereas in 
0.7 they had two-tuple members.

# Old version:
>>> from mock import MagicMock
>>> a = MagicMock()
>>> a.foo("hello")
<mock.MagicMock object at 0xa40cecc>
>>> a.foo("goodbye")
<mock.MagicMock object at 0xa40cecc>
>>> a.foo.call_args_list
[(('hello',), {}), (('goodbye',), {})]
>>> a.foo.call_args_list[0]
(('hello',), {})
>>> a.foo.call_args_list[0][0]
('hello',)
>>> a.foo.call_args_list[0][0][0]
'hello'

# New version:
>>> from mock import MagicMock
>>> a = MagicMock()
>>> a.foo("hello")
<mock.MagicMock object at 0x9f704ec>
>>> a.foo("goodbye")
<mock.MagicMock object at 0x9f704ec>
>>> a.foo.call_args_list
[(('hello',), {}), (('goodbye',), {})]
>>> a.foo.call_args_list[0]
(('hello',), {})
>>> a.foo.call_args_list[0][0]
''
>>> a.foo.call_args_list[0][0][0]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IndexError: string index out of range

Original issue reported on code.google.com by fuzzyman on 25 Jul 2011 at 5:37

GoogleCodeExporter commented 9 years ago
The same will be true for .call_args - this will be a three tuple instead of a 
two tuple.

Original comment by fuzzyman on 25 Jul 2011 at 5:42

GoogleCodeExporter commented 9 years ago
Fixed on head. All this code probably needs revisiting and cleaning up though.

Original comment by fuzzyman on 25 Jul 2011 at 11:11

GoogleCodeExporter commented 9 years ago
Issue 112 has been merged into this issue.

Original comment by fuzzyman on 27 Jul 2011 at 10:22