Website: add template and basic stylesheet with menu. Update buildhtml.py (and theref...
[docutils.git] / sandbox / gitpull / web_stylesheet_and_menu / test / test_parsers / test_rst / test_directives / test_code_none.py
blob63d5c2a293d7657069af4162b43f57f4f777f6d4
1 #! /usr/bin/env python
3 # $Id$
4 # Author: Guenter Milde
5 # Copyright: This module has been placed in the public domain.
7 """
8 Test the 'code' directive in body.py with syntax_highlight = 'none'.
9 """
11 from __init__ import DocutilsTestSupport
13 def suite():
14 s = DocutilsTestSupport.ParserTestSuite(suite_settings={'syntax_highlight':'none'})
15 s.generateTests(totest)
16 return s
18 totest = {}
20 totest['code-parsing-none'] = [
21 ["""\
22 .. code::
24 This is a code block.
25 """,
26 """\
27 <document source="test data">
28 <literal_block classes="code" xml:space="preserve">
29 This is a code block.
30 """],
31 ["""\
32 .. code:: python
33 :number-lines: 7
35 def my_function():
36 '''Test the lexer.
37 '''
39 # and now for something completely different
40 print 8/2
41 """,
42 """\
43 <document source="test data">
44 <literal_block classes="code python" xml:space="preserve">
45 <inline classes="ln">
46 7 \n\
47 def my_function():
48 <inline classes="ln">
49 8 \n\
50 \'\'\'Test the lexer.
51 <inline classes="ln">
52 9 \n\
53 \'\'\'
54 <inline classes="ln">
55 10 \n\
56 \n\
57 <inline classes="ln">
58 11 \n\
59 # and now for something completely different
60 <inline classes="ln">
61 12 \n\
62 print 8/2
63 """],
64 ["""\
65 .. code:: latex
67 hello \emph{world} % emphasize
68 """,
69 """\
70 <document source="test data">
71 <literal_block classes="code latex" xml:space="preserve">
72 hello \\emph{world} % emphasize
73 """],
77 if __name__ == '__main__':
78 import unittest
79 unittest.main(defaultTest='suite')