__init__.py 文件源码

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

项目:widgetastic.patternfly 作者: RedHatQE 项目源码 文件源码
def validate_node(self, node, matcher, image):
        """Helper method that matches nodes by given conditions.

        Args:
            node: Node that is matched
            matcher: If it is an instance of regular expression, that one is used, otherwise
                equality comparison is used. Against item name.
            image: If not None, then after the matcher matches, this will do an additional check for
                the image name

        Returns:
            A :py:class:`bool` if the node is correct or not.
        """
        text = self.browser.text(node)
        if isinstance(matcher, re._pattern_type):
            match = matcher.match(text) is not None
        else:
            match = matcher == text
        if not match:
            return False
        if image is not None and self.image_getter(node) != image:
            return False
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号