~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/doc_generate/builders/test_texinfo.py

  • Committer: Vincent Ladeuil
  • Date: 2010-05-05 15:03:51 UTC
  • mto: (5355.1.1 integration)
  • mto: This revision was merged to the branch mainline in revision 5356.
  • Revision ID: v.ladeuil+lp@free.fr-20100505150351-phq5w3ws3x9p2h9l
Implement bullet list generation.

* bzrlib/tests/doc_generate/builders/test_texinfo.py:
(TestListGeneration): Start testing list generation with bullet list.

* bzrlib/doc_generate/writers/texinfo.py:
(TexinfoTranslator.depart_paragraph): Paragraphs should be
followed by a blank line.
(TexinfoTranslator.depart_compact_paragraph): No difference
between paragraphs and compact paragraphs so far.
(TexinfoTranslator.visit_bullet_list)
(TexinfoTranslator.depart_bullet_list): Implement bullet list.
(TexinfoTranslator.visit_list_item)
(TexinfoTranslator.depart_list_item): Implement list item.

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        app.build(True, [])
107
107
        # Note that since the input is a paragraph, we get two \n (even if the
108
108
        # input has none)
109
 
        self.assertFileEqual("""\n@emph{important}\n""", 'index.texi')
 
109
        self.assertFileEqual("""@emph{important}\n\n""", 'index.texi')
110
110
 
111
111
    def test_strong(self):
112
112
        self.build_tree_contents([('index.txt', """**very important**"""),])
114
114
        app.build(True, [])
115
115
        # Note that since the input is a paragraph, we get two \n (even if the
116
116
        # input has none)
117
 
        self.assertFileEqual("""\n@strong{very important}\n""", 'index.texi')
 
117
        self.assertFileEqual("""@strong{very important}\n\n""", 'index.texi')
118
118
 
119
119
    def test_paragraphs(self):
120
120
        self.build_tree_contents([('index.txt', """\
125
125
        app, out, err = self.make_sphinx()
126
126
        app.build(True, [])
127
127
        self.assertFileEqual("""\
128
 
 
129
128
This is a paragraph.
130
129
 
131
130
This is another one.
 
131
 
132
132
""", 'index.texi')
133
133
 
134
134
 
143
143
        app, out, err = self.make_sphinx()
144
144
        app.build(True, [])
145
145
        self.assertFileEqual("""@title Bazaar Release Notes\n""", 'index.texi')
 
146
 
 
147
 
 
148
class TestListGeneration(TestSphinx):
 
149
 
 
150
    def test_bullet_list(self):
 
151
        self.build_tree_contents([('index.txt', """\
 
152
* This is a bulleted list.
 
153
* It has two items, the second
 
154
  item uses two lines.
 
155
"""),])
 
156
        app, out, err = self.make_sphinx()
 
157
        app.build(True, [])
 
158
        print err.getvalue()
 
159
        self.assertFileEqual("""\
 
160
@itemize @bullet
 
161
@item
 
162
This is a bulleted list.
 
163
 
 
164
@item
 
165
It has two items, the second
 
166
item uses two lines.
 
167
 
 
168
@end itemize
 
169
""",
 
170
 'index.texi')