コード例 #1
0
def test_full_msg_with_cjk():
    ret = _full_msg(
        start='啊あ아',
        end_msg='end',
        end_color='',
        use_color=False,
        cols=15,
    )
    # 5 dots: 15 - 6 - 3 - 1
    assert ret == '啊あ아.....end\n'
コード例 #2
0
def test_full_msg_with_color():
    ret = _full_msg(
        start='start',
        end_msg='end',
        end_color=color.RED,
        use_color=True,
        cols=15,
    )
    # 6 dots: 15 - 5 - 3 - 1
    assert ret == f'start......{color.RED}end{color.NORMAL}\n'
コード例 #3
0
def test_full_msg():
    ret = _full_msg(
        start='start',
        end_msg='end',
        end_color='',
        use_color=False,
        cols=15,
    )
    # 6 dots: 15 - 5 - 3 - 1
    assert ret == 'start......end\n'
コード例 #4
0
def test_full_msg_postfix_not_colored():
    ret = _full_msg(
        start='start',
        postfix='post ',
        end_msg='end',
        end_color=color.RED,
        use_color=True,
        cols=20,
    )
    # 6 dots: 20 - 5 - 5 - 3 - 1
    assert ret == f'start......post {color.RED}end{color.NORMAL}\n'
コード例 #5
0
def test_full_msg_with_postfix():
    ret = _full_msg(
        start='start',
        postfix='post ',
        end_msg='end',
        end_color='',
        use_color=False,
        cols=20,
    )
    # 6 dots: 20 - 5 - 5 - 3 - 1
    assert ret == 'start......post end\n'