diff options
| author | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2011-04-25 23:28:40 +0000 |
|---|---|---|
| committer | grubert <grubert@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2011-04-25 23:28:40 +0000 |
| commit | d9da93c19fe4f4c9e8b113bc9f07d9f950bc39a0 (patch) | |
| tree | d5ef754cc3746ccd4ec2c4e53f950f4bad53db71 /docutils/test | |
| parent | b21c157b137950d96f38442c1e1d03252bcdfb98 (diff) | |
| download | docutils-d9da93c19fe4f4c9e8b113bc9f07d9f950bc39a0.tar.gz | |
test fallback to english role BUG 1830380
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@7018 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
| -rw-r--r-- | docutils/test/test_parsers/test_rst/test_directives/test_replace_fr.py | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/docutils/test/test_parsers/test_rst/test_directives/test_replace_fr.py b/docutils/test/test_parsers/test_rst/test_directives/test_replace_fr.py new file mode 100644 index 000000000..68c00fe0b --- /dev/null +++ b/docutils/test/test_parsers/test_rst/test_directives/test_replace_fr.py @@ -0,0 +1,80 @@ +#! /usr/bin/env python + +# $Id: test_replace.py 4667 2006-07-12 21:40:56Z wiemann $ +# Author: David Goodger <goodger@python.org> +# Copyright: This module has been placed in the public domain. + +""" +Tests for misc.py "replace" directive. +Test in french (not default/fallback language). +""" + +from __init__ import DocutilsTestSupport + + +def suite(): + s = DocutilsTestSupport.ParserTestSuite(suite_settings={'language_code':'fr'}) + s.generateTests(totest) + return s + +totest = {} + +totest['replace'] = [ +["""\ +Test directive containing french role exposant (superscript). + +.. |Na+| remplace:: Na\ :exp:`+` + +Le |Na+| est l'ion sodium. +""", +"""\ +<document source="test data"> + <paragraph> + Test directive containing french role exposant (superscript). + <substitution_definition names="Na+"> + Na + <superscript> + + + <paragraph> + Le \n\ + <substitution_reference refname="Na+"> + Na+ + est l\'ion sodium. +"""], +["""\ +Test directive containing english role superscript. +BUG 1830380: the ERROR is an ERROR and the WARNING a followup to the ERROR + +.. |Na+| remplace:: Na\ :sup:`+` + +Le |Na+| est l'ion sodium. +""", +"""\ +<document source="test data"> + <paragraph> + Test directive containing english role superscript. + BUG 1830380: the ERROR is an ERROR and the WARNING a followup to the ERROR + <system_message level="1" line="4" source="test data" type="INFO"> + <paragraph> + No role entry for "sup" in module "docutils.parsers.rst.languages.fr". + Using English fallback for role "sup". + <system_message level="3" line="4" source="test data" type="ERROR"> + <paragraph> + Error in "remplace" directive: may contain a single paragraph only. + <system_message level="2" line="4" source="test data" type="WARNING"> + <paragraph> + Substitution definition "Na+" empty or invalid. + <literal_block xml:space="preserve"> + .. |Na+| remplace:: Na\\ :sup:`+` + <paragraph> + Le \n\ + <substitution_reference refname="Na+"> + Na+ + est l\'ion sodium. +"""], +] + + +if __name__ == '__main__': + import unittest + unittest.main(defaultTest='suite') |
