test_ReportWrapper.py 文件源码

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

项目:AutoTriageBot 作者: salesforce 项目源码 文件源码
def callAllMethods(obj: object) -> List[Tuple[str, Any]]:
    results = []  # type: List[Tuple[str, Any]]
    for method in dir(obj):
        if method == '__hash__':
            continue
        if callable(getattr(obj, method)):
            try:
                res = getattr(obj, method)()
                if isinstance(res, bool) or isinstance(res, int):
                    results.append((method, res))
                if isinstance(res, str):
                    # Ignore anything with 0x in it since memory addresses change
                    if '0x' not in res:
                        results.append((method, res))
            except:
                if '0x' not in method:
                    results.append(('except', method))
    return results
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号