4 # Contact: dkuhlman@rexx.com
7 # Copyright: This module has been placed in the public domain.
10 Tests for python_latex writer.
13 from __init__
import DocutilsTestSupport
16 s
= DocutilsTestSupport
.PythonLatexPublishTestSuite()
17 s
.generateTests(totest
)
23 ==========================
24 Unit Test for Python LaTeX
25 ==========================
29 :address: dkuhlman@rexx.com \\\\
30 http://www.rexx.com/~dkuhlman
35 :copyright: Copyright (c) 2003 Dave Kuhlman.
36 [an Open Source copyright]
38 :abstract: This document contains input for unit tests for the
39 Python LaTeX writer for Docutils.
41 .. sectnum:: :depth: 2
48 latex_head
= r
"""\documentclass{howto}
50 % generator -- Docutils: http://docutils.sourceforge.net/
51 % writer -- documenting_python
52 % generated on -- Wed Aug 13 16:08:04 2003
55 \title{Unit Test for Python LaTeX}
59 \authoraddress{dkuhlman@rexx.com \
60 http://www.rexx.com/\~{}dkuhlman}
64 \chapter*{Front Matter\label{front}}
67 Copyright (c) 2003 Dave Kuhlman.
68 [an Open Source copyright]
72 This document contains input for unit tests for the
73 Python LaTeX writer for Docutils.
81 totest
['section_headers'] = [
87 Content for section #1.
92 Content for sub-section #1-1.
97 Content for sub-section #1-2.
102 Content for section #2.
108 %___________________________________________________________________________
110 \section{1 Section {\#}1\label{section-1}}
112 Content for section {\#}1.
115 %___________________________________________________________________________
117 \subsection{1.1 Subsection {\#}1-1\label{subsection-1-1}}
119 Content for sub-section {\#}1-1.
122 %___________________________________________________________________________
124 \subsection{1.2 Subsection {\#}1-2\label{subsection-1-2}}
126 Content for sub-section {\#}1-2.
129 %___________________________________________________________________________
131 \section{2 Section {\#}2\label{section-2}}
133 Content for section {\#}2.
139 # ==============================================================
141 totest
['enumerated_lists'] = [
144 Enumerated List Test Section
145 ============================
147 Here is an enumerated list:
159 %___________________________________________________________________________
161 \section{1 Enumerated List Test Section\label{enumerated-list-test-section}}
163 Here is an enumerated list:
181 # ==============================================================
183 totest
['itemized_lists'] = [
186 Itemized List Test Section
187 ==========================
189 Here is an itemized list:
201 %___________________________________________________________________________
203 \section{1 Itemized List Test Section\label{itemized-list-test-section}}
205 Here is an itemized list:
222 # ==============================================================
230 Content for section #1.
235 Content for sub-section #1-1.
240 Content for sub-section #1-2.
245 Content for section #2.
250 Here is a link to the section which is the target of this
251 internal link `Subsection #1-1`_.
257 %___________________________________________________________________________
259 \section{1 Section {\#}1\label{section-1}}
261 Content for section {\#}1.
264 %___________________________________________________________________________
266 \subsection{1.1 Subsection {\#}1-1\label{subsection-1-1}}
268 Content for sub-section {\#}1-1.
271 %___________________________________________________________________________
273 \subsection{1.2 Subsection {\#}1-2\label{subsection-1-2}}
275 Content for sub-section {\#}1-2.
278 %___________________________________________________________________________
280 \section{2 Section {\#}2\label{section-2}}
282 Content for section {\#}2.
285 %___________________________________________________________________________
287 \section{3 Links Test Section\label{links-test-section}}
289 Here is a link to the section which is the target of this
290 internal link \ref{subsection-1-1}.
296 # ==============================================================
298 totest
['seealso'] = [
304 `Docutils: Python Documentation Utilities`_
306 .. _`Docutils: Python Documentation Utilities`:
307 http://docutils.sourceforge.net/
313 %___________________________________________________________________________
315 \section{1 See Also\label{see-also}}
317 \ulink{Docutils: Python Documentation Utilities}{http://docutils.sourceforge.net/}
324 # ==============================================================
326 totest
['emphasis'] = [
332 This section contains *some emphaized text*.
334 It **also has some bold text**.
336 And ``this is sample text``, or, as it is known in reStructured
337 Text, an in-line literal.
343 %___________________________________________________________________________
345 \section{1 Section {\#}1\label{section-1}}
347 This section contains \emph{some emphaized text}.
349 It \strong{also has some bold text}.
351 And \samp{this is sample text}, or, as it is known in reStructured
352 Text, an in-line literal.
359 # ==============================================================
361 totest
['blockquote'] = [
367 This section contains a paragraph which is followed by a block
368 quote. The block quote is a simple paragraph that is indented.
370 This is the block quoted paragraph. It has several sentences.
371 These sentences have empty content because they are only a
372 test. This is a test. This is a test. This is a test. This
373 is a test. This is a test. This is a test.
376 Python Iteractive Session Test
377 ==============================
379 This section has a Python interactive session. It is a test.
380 Here is the example session.
383 >>> print sys.version
384 2.3 (#1, Jul 31 2003, 15:26:15)
385 [GCC 3.2.3 20030415 (Debian prerelease)]
398 This section has a literal block. In Python LaTeX it will be
399 formatted in a verbatim environment::
401 def remove_lines(self, inStr, targetList):
402 inLines = inStr.splitlines()
406 for target in targetList:
407 if line.find(target) > -1:
410 outLines.append(line)
411 outStr = '\n'.join(outLines)
418 %___________________________________________________________________________
420 \section{1 Block Quote Test\label{block-quote-test}}
422 This section contains a paragraph which is followed by a block
423 quote. The block quote is a simple paragraph that is indented.
426 This is the block quoted paragraph. It has several sentences.
427 These sentences have empty content because they are only a
428 test. This is a test. This is a test. This is a test. This
429 is a test. This is a test. This is a test.
433 %___________________________________________________________________________
435 \section{2 Python Iteractive Session Test\label{python-iteractive-session-test}}
437 This section has a Python interactive session. It is a test.
438 Here is the example session.
441 >>> print sys.version
442 2.3 (#1, Jul 31 2003, 15:26:15)
443 [GCC 3.2.3 20030415 (Debian prerelease)]
454 %___________________________________________________________________________
456 \section{3 Literal Block Test\label{literal-block-test}}
458 This section has a literal block. In Python LaTeX it will be
459 formatted in a verbatim environment:
462 def remove_lines(self, inStr, targetList):
463 inLines = inStr.splitlines()
467 for target in targetList:
468 if line.find(target) > -1:
471 outLines.append(line)
472 outStr = '\n'.join(outLines)
481 # ==============================================================
483 if __name__
== '__main__':
485 unittest
.main(defaultTest
='suite')