File: test_span.py

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


def test_span():
    t = Textile()
    result = t.retrieveTags(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.retrieveTags(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.retrieveTags(t.span('_-*test*-_'))
    expect = '<em><del>*test*</del></em>'
    assert result == expect