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’s Cradle</cite> by Vonnegut</p>'
assert result == expect
|