utils.py 文件源码

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

项目:RobotFrameworkReporter 作者: ivanitskiy 项目源码 文件源码
def _extarct_only_robot(xmlfile):
    """remove from file not robot's elements
    robot elements are: 'suite' 'statistics' 'errors'
    """

    original_doc = ET.parse(xmlfile)
    root = original_doc.getroot()
    devices = root.find("devices")
    if devices is not None:
        root.remove(devices)

    source = StringIO(ET.tostring(root))
    ets = ETSource(source)
    execution_result = ExecutionResultBuilder(ets).build(Result())
    patched_file = File(BytesIO(force_bytes(source.getvalue())), name=xmlfile.name)
    return (execution_result, patched_file)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号