mock.py 文件源码

python
阅读 27 收藏 0 点赞 0 评论 0

项目:RPoint 作者: george17-meet 项目源码 文件源码
def _call_matcher(self, _call):
        """
        Given a call (or simply a (args, kwargs) tuple), return a
        comparison key suitable for matching with other calls.
        This is a best effort method which relies on the spec's signature,
        if available, or falls back on the arguments themselves.
        """
        sig = self._spec_signature
        if sig is not None:
            if len(_call) == 2:
                name = ''
                args, kwargs = _call
            else:
                name, args, kwargs = _call
            try:
                return name, sig.bind(*args, **kwargs)
            except TypeError as e:
                e.__traceback__ = None
                return e
        else:
            return _call
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号