Spelling fixes
[docutils.git] / test / test_parsers / test_rst / test_directives / test_math.py
blobf115aee0974e4952d3cd98937fbc3c24b16a3b2d
1 #! /usr/bin/env python
3 # $Id$
4 # Author: Guenter Milde <milde@users.sf.net>
5 # Copyright: This module has been placed in the public domain.
7 """
8 Tests for the 'math' directive.
9 """
11 from __init__ import DocutilsTestSupport
13 def suite():
14 s = DocutilsTestSupport.ParserTestSuite()
15 s.generateTests(totest)
16 return s
18 totest = {}
20 totest['argument'] = [
21 ["""\
22 .. math:: y = f(x)
23 """,
24 """\
25 <document source="test data">
26 <math_block xml:space="preserve">
27 y = f(x)
28 """],
31 totest['content'] = [
32 ["""\
33 .. math::
35 1+1=2
36 """,
37 """\
38 <document source="test data">
39 <math_block xml:space="preserve">
40 1+1=2
41 """],
44 totest['options'] = [
45 ["""\
46 .. math::
47 :class: new
48 :name: eq:Eulers law
50 e^i*2*\pi = 1
51 """,
52 """\
53 <document source="test data">
54 <math_block classes="new" ids="eq-eulers-law" names="eq:eulers\ law" xml:space="preserve">
55 e^i*2*\pi = 1
56 """],
59 totest['argument_and_content'] = [
60 ["""\
61 .. math:: y = f(x)
63 1+1=2
65 """,
66 """\
67 <document source="test data">
68 <math_block xml:space="preserve">
69 y = f(x)
70 <math_block xml:space="preserve">
71 1+1=2
72 """],
75 totest['content with blank line'] = [
76 ["""\
77 .. math::
79 1+1=2
81 E = mc^2
82 """,
83 """\
84 <document source="test data">
85 <math_block xml:space="preserve">
86 1+1=2
87 <math_block xml:space="preserve">
88 E = mc^2
89 """],
93 if __name__ == '__main__':
94 import unittest
95 unittest.main(defaultTest='suite')