File: test_subclassing.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 (17 lines) | stat: -rw-r--r-- 504 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import textile


def test_change_glyphs():
    class TextilePL(textile.Textile):
        glyph_definitions = dict(textile.Textile.glyph_definitions,
                                 quote_double_open='„')

    test = 'Test "quotes".'
    expect = '\t<p>Test &#8222;quotes&#8221;.</p>'
    result = TextilePL().parse(test)
    assert expect == result

    # Base Textile is unchanged.
    expect = '\t<p>Test &#8220;quotes&#8221;.</p>'
    result = textile.textile(test)
    assert expect == result