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'
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'
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'
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'
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'