test_display.py 文件源码

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

项目:artemis 作者: QUVA-Lab 项目源码 文件源码
def test_document_wrapper():
    """
    Document Wrapper is deals with wrapping text with new lines already present.
    :return:
    """

    str3="0123456789\n0123456789\n01234567890123456789"

    desired3="0123456789\n0123456789\n012345678901\n23456789"

    w1 = textwrap.TextWrapper(width=12, replace_whitespace=False)
    r1 = w1.fill(str3)
    assert r1 != desired3
    assert r1 == "0123456789\n0123456789\n0\n123456789012\n3456789"

    w2 = DocumentWrapper(width=12, replace_whitespace=False)
    r2 = w2.fill(str3)
    assert r2 == desired3
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号