File: test_span.py

package info (click to toggle)
python-textile 1%3A4.0.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 452 kB
  • sloc: python: 2,620; sh: 7; makefile: 4
file content (19 lines) | stat: -rw-r--r-- 630 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
from textile import Textile

def test_span():
    t = Textile()
    result = t.span("hello %(bob)span *strong* and **bold**% goodbye")
    expect = ('hello <span class="bob">span <strong>strong</strong> and '
            '<b>bold</b></span> goodbye')
    assert result == expect

    result = t.span('%:http://domain.tld test%')
    expect = '<span cite="http://domain.tld">test</span>'
    assert result == expect

    t = Textile()
    # cover the partial branch where we exceed the max_span_depth.
    t.max_span_depth = 2
    result = t.span('_-*test*-_')
    expect = '<em><del>*test*</del></em>'
    assert result == expect