示例#1
0
def test_string_maker_align_center_padding_star():
    test_word = 'AAAAA'
    length = 20
    padding = '*'
    text_align_center_padding_star = text_formatter.string_maker(
        length=length, align='MID', padding=padding)
    assert text_align_center_padding_star(test_word) \
        == test_word.center(length, padding)
示例#2
0
def test_string_maker_length():
    length = 10
    text_length_10 = text_formatter.string_maker(length=length)
    assert len(text_length_10('12345')) == length
示例#3
0
def test_string_maker_align_right():
    test_word = 'AAAAA'
    length = 20
    text_align_right = text_formatter.string_maker(length=length,
                                                   align='RIGHT')
    assert text_align_right(test_word) == test_word.rjust(length, ' ')
示例#4
0
def test_string_maker_align_center():
    test_word = 'AAAAA'
    length = 20
    text_align_center = text_formatter.string_maker(length=length, align='MID')
    assert text_align_center(test_word) == test_word.center(length, ' ')
示例#5
0
def test_string_maker_align_left():
    test_word = 'AAAAA'
    length = 20
    text_align_left = text_formatter.string_maker(length=length)
    assert text_align_left(test_word) == test_word.ljust(length, ' ')