/usr/lib/python2.7/dist-packages/exam/mock.py is in python-exam 0.10.5-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | from __future__ import absolute_import
from mock import Mock as BaseMock
from mock import call
class Mock(BaseMock):
def assert_called(self):
assert self.called
def assert_not_called(self):
assert not self.called
def assert_not_called_with(self, *args, **kwargs):
assert not call(*args, **kwargs) == self.call_args
def assert_not_called_once_with(self, *args, **kwargs):
assert len(self.__calls_matching(*args, **kwargs)) is not 1
def assert_not_any_call(self, *args, **kwargs):
assert len(self.__calls_matching(*args, **kwargs)) is 0
def __calls_matching(self, *args, **kwargs):
calls_match = lambda other_call: call(*args, **kwargs) == other_call
return list(filter(calls_match, self.call_args_list))
|