From a37b958d6540be7bb3cf181e448f1267c0e2824c Mon Sep 17 00:00:00 2001 From: Kushal Das Date: Tue, 16 Sep 2014 18:33:37 +0530 Subject: Closes #21270 : We now override tuple methods in mock.call objects. --- Lib/unittest/mock.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'Lib/unittest/mock.py') diff --git a/Lib/unittest/mock.py b/Lib/unittest/mock.py index d00197688ae..1c2dd1c1e20 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' -- cgit v1.2.3