def test_align_right_wide_fill_needs_padding(): """Test when fill_char's display width does not divide evenly into gap""" text = 'foo' fill_char = '苹' width = 6 aligned = cu.align_right(text, fill_char=fill_char, width=width) assert aligned == fill_char + ' ' + text
def test_align_right_wide_text(): text = '苹' fill_char = '-' width = 4 aligned = cu.align_right(text, fill_char=fill_char, width=width) assert aligned == fill_char + fill_char + text
def test_align_right_wide_fill(): text = 'foo' fill_char = '苹' width = 5 aligned = cu.align_right(text, fill_char=fill_char, width=width) assert aligned == fill_char + text
def test_align_right_multiline(): text = "foo\nshoes" fill_char = '-' width = 7 aligned = cu.align_right(text, fill_char=fill_char, width=width) assert aligned == ('----foo\n' '--shoes')