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 settings_overrides
={} #{'debug': True}
9 self
.output
= publish_string(input, writer_name
='texinfo', settings_overrides
=settings_overrides
)
12 self
.writer
= InfoWriter()
14 def test_writer_supports_texinfo(self
):
15 self
.assertTrue(self
.writer
.supports('texinfo'))
17 def test_translate_alice(self
):
19 ********************************
21 ********************************
23 ================================
25 ================================
27 CHAPTER I. Down the Rabbit-Hole
28 ===============================
30 Alice was beginning to get very tired of sitting by her sister on the
31 bank, and of having nothing to do: once or twice she had peeped into the
32 book her sister was reading, but it had no pictures or conversations in
33 it, 'and what is the use of a book,' thought Alice 'without pictures or
36 self
.assertEqual(self
.output
,
37 """\\input texinfo @c -*-texinfo-*-
40 @top Alice In Wonderland
42 @chapter CHAPTER I. Down the Rabbit-Hole
43 Alice was beginning to get very tired of sitting by her sister on the
44 bank, and of having nothing to do: once or twice she had peeped into the
45 book her sister was reading, but it had no pictures or conversations in
46 it, 'and what is the use of a book,' thought Alice 'without pictures or
51 def test_translate_frisbeetarianism(self
):
57 Frisbeetarianism is the belief that, when you die, your soul goes up
58 onto the roof and gets stuck.
60 Keep in mind always the four constant Laws of Frisbee:
62 (1) The most powerful force in the world is that of a disc
63 straining to land under a car, just out of reach (this
64 force is technically termed "car suck").
65 (2) Never precede any maneuver by a comment more predictive
67 (3) The probability of a Frisbee hitting something is directly
68 proportional to the cost of hitting it. For instance, a
69 Frisbee will always head directly towards a policeman or
70 a little old lady rather than the beat up Chevy.
71 (4) Your best throw happens when no one is watching; when the
72 cute girl you've been trying to impress is watching, the
73 Frisbee will invariably bounce out of your hand or hit you
74 in the head and knock you silly.
77 self
.assertEqual(self
.output
,
78 """\\input texinfo @c -*-texinfo-*-
82 Frisbeetarianism is the belief that, when you die, your soul goes up
83 onto the roof and gets stuck.
85 Keep in mind always the four constant Laws of Frisbee:
90 The most powerful force in the world is that of a disc
91 straining to land under a car, just out of reach (this
92 force is technically termed "car suck").
95 Never precede any maneuver by a comment more predictive
99 The probability of a Frisbee hitting something is directly
100 proportional to the cost of hitting it. For instance, a
101 Frisbee will always head directly towards a policeman or
102 a little old lady rather than the beat up Chevy.
105 Your best throw happens when no one is watching; when the
106 cute girl you've been trying to impress is watching, the
107 Frisbee will invariably bounce out of your hand or hit you
108 in the head and knock you silly.
116 if __name__
=='__main__':