forked from github/pelican
Fix tests with latest versions of smartypants.
smartypants is now py3 compatible but the default settings for double quotes has been changed (http://pythonhosted.org/smartypants/changes.html). This commit: - update the typogrify test (change quotes, and add more test casesi: caps word, ellipsis) - install typogrify on travis - uses upstream version of smartypants in tox instead of dmdm's fork for py3
This commit is contained in:
parent
dbbf95b184
commit
a49b744e95
4 changed files with 10 additions and 8 deletions
|
|
@ -8,6 +8,8 @@ before_install:
|
||||||
- sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8
|
- sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8
|
||||||
install:
|
install:
|
||||||
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install typogrify ; fi
|
||||||
|
- if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then pip install git+https://github.com/dmdm/typogrify.git@py3k#egg=typogrify; fi
|
||||||
- pip install mock nose nose-cov Markdown
|
- pip install mock nose nose-cov Markdown
|
||||||
- pip install .
|
- pip install .
|
||||||
script: nosetests -sv --with-coverage --cover-package=pelican pelican
|
script: nosetests -sv --with-coverage --cover-package=pelican pelican
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
Article title
|
Article title
|
||||||
#############
|
#############
|
||||||
|
|
||||||
This is some content. With some stuff to "typogrify".
|
THIS is some content. With some stuff to "typogrify"...
|
||||||
|
|
||||||
Now with added support for :abbr:`TLA (three letter acronym)`.
|
Now with added support for :abbr:`TLA (three letter acronym)`.
|
||||||
|
|
|
||||||
|
|
@ -104,8 +104,8 @@ class RstReaderTest(ReaderTest):
|
||||||
# if nothing is specified in the settings, the content should be
|
# if nothing is specified in the settings, the content should be
|
||||||
# unmodified
|
# unmodified
|
||||||
page = self.read_file(path='article.rst')
|
page = self.read_file(path='article.rst')
|
||||||
expected = ('<p>This is some content. With some stuff to '
|
expected = ('<p>THIS is some content. With some stuff to '
|
||||||
'"typogrify".</p>\n<p>Now with added '
|
'"typogrify"...</p>\n<p>Now with added '
|
||||||
'support for <abbr title="three letter acronym">'
|
'support for <abbr title="three letter acronym">'
|
||||||
'TLA</abbr>.</p>\n')
|
'TLA</abbr>.</p>\n')
|
||||||
|
|
||||||
|
|
@ -114,10 +114,11 @@ class RstReaderTest(ReaderTest):
|
||||||
try:
|
try:
|
||||||
# otherwise, typogrify should be applied
|
# otherwise, typogrify should be applied
|
||||||
page = self.read_file(path='article.rst', TYPOGRIFY=True)
|
page = self.read_file(path='article.rst', TYPOGRIFY=True)
|
||||||
expected = ('<p>This is some content. With some stuff to '
|
expected = (
|
||||||
'“typogrify”.</p>\n<p>Now with added '
|
'<p><span class="caps">THIS</span> is some content. '
|
||||||
'support for <abbr title="three letter acronym">'
|
'With some stuff to "typogrify"…</p>\n'
|
||||||
'<span class="caps">TLA</span></abbr>.</p>\n')
|
'<p>Now with added support for <abbr title="three letter '
|
||||||
|
'acronym"><span class="caps">TLA</span></abbr>.</p>\n')
|
||||||
|
|
||||||
self.assertEqual(page.content, expected)
|
self.assertEqual(page.content, expected)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
|
|
|
||||||
1
tox.ini
1
tox.ini
|
|
@ -22,6 +22,5 @@ deps =
|
||||||
mock
|
mock
|
||||||
Markdown
|
Markdown
|
||||||
BeautifulSoup4
|
BeautifulSoup4
|
||||||
git+https://github.com/dmdm/smartypants.git#egg=smartypants
|
|
||||||
git+https://github.com/dmdm/typogrify.git@py3k#egg=typogrify
|
git+https://github.com/dmdm/typogrify.git@py3k#egg=typogrify
|
||||||
lxml
|
lxml
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue