From cbeeec900837cf6fa75bbc9a617e2d00a693be4a Mon Sep 17 00:00:00 2001 From: goodger Date: Thu, 8 Dec 2005 04:43:13 +0000 Subject: merged branches/s5 changes r4011:4155 into trunk/docutils git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@4156 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/test/test_transforms/test_target_notes.py | 84 ++++++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100755 docutils/test/test_transforms/test_target_notes.py (limited to 'docutils/test/test_transforms') diff --git a/docutils/test/test_transforms/test_target_notes.py b/docutils/test/test_transforms/test_target_notes.py new file mode 100755 index 000000000..cf625572d --- /dev/null +++ b/docutils/test/test_transforms/test_target_notes.py @@ -0,0 +1,84 @@ +#! /usr/bin/env python + +# Author: David Goodger +# Contact: goodger@users.sourceforge.net +# Revision: $Revision$ +# Date: $Date$ +# Copyright: This module has been placed in the public domain. + +""" +Tests for `docutils.transforms.references.TargetNotes` (via +`docutils.transforms.universal.LastReaderPending`). +""" + +from __init__ import DocutilsTestSupport +from docutils.transforms.references import PropagateTargets, \ + AnonymousHyperlinks, IndirectHyperlinks, ExternalTargets, \ + InternalTargets, DanglingReferences, Footnotes +from docutils.parsers.rst import Parser + + +def suite(): + parser = Parser() + s = DocutilsTestSupport.TransformTestSuite(parser) + s.generateTests(totest) + return s + +totest = {} + +totest['tables_of_contents'] = ((PropagateTargets, AnonymousHyperlinks, + IndirectHyperlinks, + ExternalTargets, InternalTargets, + DanglingReferences, + ), [ +["""\ +.. _target: http://exammple.org + +A reference to a target_. + +.. target-notes:: +""", +"""\ + + + + A reference to a \n\ + + target + \n\ + + . + + + + http://exammple.org +"""], +["""\ +.. _target: http://exammple.org + +A reference to a target_. + +.. target-notes:: :class: custom +""", +"""\ + + + + A reference to a \n\ + + target + + \n\ + + . + + + + http://exammple.org +"""], +]) + + +if __name__ == '__main__': + import unittest + unittest.main(defaultTest='suite') -- cgit v1.2.1