2 from info_writer
import InfoWriter
4 class T(unittest
.TestCase
):
6 def given_input(self
, input):
7 from docutils
.core
import publish_string
8 self
.output
= publish_string(input, writer_name
='texinfo')
11 self
.writer
= InfoWriter()
13 def test_writer_supports_texinfo(self
):
14 self
.assertTrue(self
.writer
.supports('texinfo'))
16 def test_translate_alice(self
):
18 ********************************
20 ********************************
22 ================================
24 ================================
26 CHAPTER I. Down the Rabbit-Hole
27 ===============================
29 Alice was beginning to get very tired of sitting by her sister on the
30 bank, and of having nothing to do: once or twice she had peeped into the
31 book her sister was reading, but it had no pictures or conversations in
32 it, 'and what is the use of a book,' thought Alice 'without pictures or
35 self
.assertEqual(self
.output
,
36 """\\input texinfo @c -*-texinfo-*-
39 @top Alice In Wonderland
41 @chapter CHAPTER I. Down the Rabbit-Hole
42 Alice was beginning to get very tired of sitting by her sister on the
43 bank, and of having nothing to do: once or twice she had peeped into the
44 book her sister was reading, but it had no pictures or conversations in
45 it, 'and what is the use of a book,' thought Alice 'without pictures or
49 def test_translate_frisbeetarianism(self
):
55 Frisbeetarianism is the belief that, when you die, your soul goes up
56 onto the roof and gets stuck.
58 Never precede any action with the words "Watch this!"
59 -- the first constant Law of Frisbee
61 self
.assertEqual(self
.output
,
62 """\\input texinfo @c -*-texinfo-*-
66 Frisbeetarianism is the belief that, when you die, your soul goes up
67 onto the roof and gets stuck.
69 Never precede any action with the words "Watch this!"
70 -- the first constant Law of Frisbee
74 if __name__
=='__main__':