コード例 #1
0
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.'
コード例 #2
0
def test_wrap_initial_width_short():
    assert lines.wrap('foo bar', width=30, initial_width=20) == 'foo bar'
コード例 #3
0
def test_wrap_subsequent_indent():
    assert lines.wrap(
        '# foo bar baz',
        width=5,
        subsequent_indent='# ',
    ) == '# foo\n# bar\n# baz'
コード例 #4
0
def test_wrap_strips():
    assert lines.wrap('foo bar baz  ', width=80) == 'foo bar baz'
コード例 #5
0
def test_wrap_simple():
    assert lines.wrap('foo bar baz', width=5) == 'foo\nbar\nbaz'
コード例 #6
0
def test_wrap_empty_text():
    assert lines.wrap('', width=80) == ''
コード例 #7
0
def test_wrap_noop():
    assert lines.wrap('foo bar baz', width=80) == 'foo bar baz'