selector_builder.py 文件源码

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

项目:nerodia 作者: watir 项目源码 文件源码
def check_type(self, how, what):
        if how == 'index':
            if not isinstance(what, int):
                raise TypeError('expected {}, got {!r}:{}'.format(int, what, what.__class__))
        elif how == 'visible':
            if not isinstance(what, bool):
                raise TypeError('expected {}, got {!r}:{}'.format(bool, what, what.__class__))
        elif how == 'visible_text':
            if type(what) not in [six.text_type, six.binary_type, re._pattern_type]:
                raise TypeError('expected str or regexp, got {}')
        else:
            if isinstance(what, list) and how != 'class_name':
                raise TypeError("only 'class_name' locator can have a value of a list")
            if type(what) not in self.VALID_WHATS:
                raise TypeError(
                    'expected one of {}, got {!r}:{}'.format(self.VALID_WHATS, what, what.__class__))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号