mirror of
https://github.com/python/cpython.git
synced 2025-07-23 03:05:38 +00:00
Closes #21270 : We now override tuple methods in mock.call objects.
This commit is contained in:
parent
a0f33759fa
commit
a37b958d65
3 changed files with 19 additions and 0 deletions
|
@ -1213,6 +1213,16 @@ class MockTest(unittest.TestCase):
|
|||
text = "call(daddy='hero', name='hello')"
|
||||
self.assertEqual(repr(m.hello.call_args), text)
|
||||
|
||||
#Issue21270 overrides tuple methods for mock.call objects
|
||||
def test_override_tuple_methods(self):
|
||||
c = call.count()
|
||||
i = call.index(132,'hello')
|
||||
m = Mock()
|
||||
m.count()
|
||||
m.index(132,"hello")
|
||||
self.assertEqual(m.method_calls[0], c)
|
||||
self.assertEqual(m.method_calls[1], i)
|
||||
|
||||
def test_mock_add_spec(self):
|
||||
class _One(object):
|
||||
one = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue