diff options
author | Kushal Das <kushaldas@gmail.com> | 2014-09-16 13:03:37 (GMT) |
---|---|---|
committer | Kushal Das <kushaldas@gmail.com> | 2014-09-16 13:03:37 (GMT) |
commit | a37b958d6540be7bb3cf181e448f1267c0e2824c (patch) | |
tree | a249ea7a1698cfb67f5a3b3bb83d972280823600 /Lib/unittest/test | |
parent | a0f33759fa03a1801f25420e66fab3f2d938244d (diff) | |
download | cpython-a37b958d6540be7bb3cf181e448f1267c0e2824c.zip cpython-a37b958d6540be7bb3cf181e448f1267c0e2824c.tar.gz cpython-a37b958d6540be7bb3cf181e448f1267c0e2824c.tar.bz2 |
Closes #21270 : We now override tuple methods in mock.call objects.
Diffstat (limited to 'Lib/unittest/test')
-rw-r--r-- | Lib/unittest/test/testmock/testmock.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Lib/unittest/test/testmock/testmock.py b/Lib/unittest/test/testmock/testmock.py index a549973..3a104cb 100644 --- a/Lib/unittest/test/testmock/testmock.py +++ b/Lib/unittest/test/testmock/testmock.py @@ -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 |