Exemplo n.º 1
0
def test_wrap_test_given_width_is_infinity_returns_text_as_string():
    text = "aaaaaa" * 100000
    expected = ("aaaaaa" * 100000, )
    assert Table.wrap_text(text, float('inf')) == expected
Exemplo n.º 2
0
def test_wrap_test_given_text_greater_than_width_wraps():
    text_ = long_text[:10]
    expected_tuple = (long_text[:8], long_text[8:10])
    text_tuple = Table.wrap_text(text_, 8)
    assert text_tuple == expected_tuple
Exemplo n.º 3
0
def test_wrap_test_given_text_equal_to_width_wraps():
    text_ = long_text[:10]
    expected_tuple = (text_, '')
    text_tuple = Table.wrap_text(text_, 10)
    assert text_tuple == expected_tuple
Exemplo n.º 4
0
def test_wrap_test_given_text_less_than_width_doesnt_wrap():
    text_ = long_text[:10]
    expected_tuple = (text_, )
    text_tuple = Table.wrap_text(text_, 11)
    assert text_tuple == expected_tuple