File: test_glyphs.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 (29 lines) | stat: -rw-r--r-- 695 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from textile import Textile


def test_glyphs():
    t = Textile()

    result = t.glyphs("apostrophe's")
    expect = 'apostrophe’s'
    assert result == expect

    result = t.glyphs("back in '88")
    expect = 'back in ’88'
    assert result == expect

    result = t.glyphs('foo ...')
    expect = 'foo …'
    assert result == expect

    result = t.glyphs('--')
    expect = '—'
    assert result == expect

    result = t.glyphs('FooBar[tm]')
    expect = 'FooBar™'
    assert result == expect

    result = t.glyphs("<p><cite>Cat's Cradle</cite> by Vonnegut</p>")
    expect = '<p><cite>Cat&#8217;s Cradle</cite> by Vonnegut</p>'
    assert result == expect