def test_wrap_initial_width(): assert lines.wrap( 'The hail in Wales falls mainly on the snails.', width=20, initial_width=8, ) == 'The hail\nin Wales falls\nmainly on the\nsnails.'
def test_wrap_initial_width_short(): assert lines.wrap('foo bar', width=30, initial_width=20) == 'foo bar'
def test_wrap_subsequent_indent(): assert lines.wrap( '# foo bar baz', width=5, subsequent_indent='# ', ) == '# foo\n# bar\n# baz'
def test_wrap_strips(): assert lines.wrap('foo bar baz ', width=80) == 'foo bar baz'
def test_wrap_simple(): assert lines.wrap('foo bar baz', width=5) == 'foo\nbar\nbaz'
def test_wrap_empty_text(): assert lines.wrap('', width=80) == ''
def test_wrap_noop(): assert lines.wrap('foo bar baz', width=80) == 'foo bar baz'