base.py 文件源码

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

项目:placebo 作者: huseyinyilmaz 项目源码 文件源码
def _get_url(self):
        """
        Returns: string_type or parse.ParseResult or parse SplitResult
        We have a vague return type for _get_url method
        because we could not generalise regex support for all
        backends. So we are directly passing result to backends.
        That way users can use regex that their backend provides.
        """
        if self.url is NotImplemented:
            raise NotImplementedError('To use placebo, you need to either '
                                      'provide url attribute or '
                                      'overwrite get_url method in subclass.')
        else:
            url = invoke_or_get(self.url)
            # if url is a string convert it to ParsedUrl
            # if isinstance(url, six.string_types):
            #     url = parse.urlparse(url)
            # TODO: check return type
            return url
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号