summaryrefslogtreecommitdiffstats
path: root/Lib/unittest/mock.py
diff options
context:
space:
mode:
authorKushal Das <kushaldas@gmail.com>2014-09-16 13:03:37 (GMT)
committerKushal Das <kushaldas@gmail.com>2014-09-16 13:03:37 (GMT)
commita37b958d6540be7bb3cf181e448f1267c0e2824c (patch)
treea249ea7a1698cfb67f5a3b3bb83d972280823600 /Lib/unittest/mock.py
parenta0f33759fa03a1801f25420e66fab3f2d938244d (diff)
downloadcpython-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/mock.py')
-rw-r--r--Lib/unittest/mock.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py
index d001976..1c2dd1c 100644
--- a/Lib/unittest/mock.py
+++ b/Lib/unittest/mock.py
@@ -2035,6 +2035,12 @@ class _Call(tuple):
return _Call(name=name, parent=self, from_kall=False)
+ def count(self, *args, **kwargs):
+ return self.__getattr__('count')(*args, **kwargs)
+
+ def index(self, *args, **kwargs):
+ return self.__getattr__('index')(*args, **kwargs)
+
def __repr__(self):
if not self.from_kall:
name = self.name or 'call'