~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010, 2011 Canonical Ltd
2
 
#
3
 
# This program is free software; you can redistribute it and/or modify
4
 
# it under the terms of the GNU General Public License as published by
5
 
# the Free Software Foundation; either version 2 of the License, or
6
 
# (at your option) any later version.
7
 
#
8
 
# This program is distributed in the hope that it will be useful,
9
 
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 
# GNU General Public License for more details.
12
 
#
13
 
# You should have received a copy of the GNU General Public License
14
 
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
 
 
17
 
"""sphinx texinfo builder tests."""
18
 
 
19
 
from bzrlib import tests
20
 
from bzrlib.doc_generate import (
21
 
    # FIXME: doc/en/conf.py should be used here, or rather merged into
22
 
    # bzrlib/doc_generate/conf.py -- vila 20100429
23
 
    conf,
24
 
    )
25
 
from bzrlib.tests import (
26
 
    doc_generate as test_dg, # Avoid clash with from bzrlib import doc_generate
27
 
    )
28
 
 
29
 
 
30
 
class TestBuilderDefined(tests.TestCase):
31
 
 
32
 
    def test_builder_defined(self):
33
 
        self.assertTrue('bzrlib.doc_generate.builders.texinfo'
34
 
                        in conf.extensions)
35
 
 
36
 
class TestBuilderLoaded(test_dg.TestSphinx):
37
 
 
38
 
    def test_builder_loaded(self):
39
 
        app, out, err = self.make_sphinx()
40
 
        self.assertTrue('texinfo' in app.builderclasses)
41
 
 
42
 
 
43
 
class TestFileProduction(test_dg.TestSphinx):
44
 
 
45
 
    def test_files_generated(self):
46
 
        self.build_tree_contents(
47
 
            [('index.txt', """
48
 
Table of Contents
49
 
=================
50
 
 
51
 
.. toctree::
52
 
   :maxdepth: 1
53
 
 
54
 
   content
55
 
"""),
56
 
             ('content.txt', """
57
 
 
58
 
bzr 0.0.8
59
 
*********
60
 
 
61
 
Improvements
62
 
============
63
 
 
64
 
* Adding a file whose parent directory is not versioned will
65
 
  implicitly add the parent, and so on up to the root.
66
 
"""),
67
 
             ])
68
 
        app, out, err = self.make_sphinx()
69
 
        self.build(app)
70
 
        self.assertPathExists('index.texi')
71
 
        self.assertPathExists('content.texi')