bzr branch
http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar
|
5557.1.7
by John Arbash Meinel
Merge in the bzr.dev 5582 |
1 |
# Copyright (C) 2010, 2011 Canonical Ltd
|
|
5193.6.2
by Vincent Ladeuil
First texinfo test. |
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
|
|
|
5193.6.4
by Vincent Ladeuil
Test that the sphinx texinfo extension is loaded. |
22 |
# bzrlib/doc_generate/conf.py -- vila 20100429
|
23 |
conf, |
|
|
5193.6.2
by Vincent Ladeuil
First texinfo test. |
24 |
)
|
|
5193.6.26
by Vincent Ladeuil
Separate builder and writer tests. |
25 |
from bzrlib.tests import ( |
26 |
doc_generate as test_dg, # Avoid clash with from bzrlib import doc_generate |
|
27 |
)
|
|
|
5193.6.2
by Vincent Ladeuil
First texinfo test. |
28 |
|
29 |
||
|
5193.6.3
by Vincent Ladeuil
Fix test names. |
30 |
class TestBuilderDefined(tests.TestCase): |
|
5193.6.2
by Vincent Ladeuil
First texinfo test. |
31 |
|
|
5193.6.3
by Vincent Ladeuil
Fix test names. |
32 |
def test_builder_defined(self): |
|
5193.6.2
by Vincent Ladeuil
First texinfo test. |
33 |
self.assertTrue('bzrlib.doc_generate.builders.texinfo' |
|
5193.6.4
by Vincent Ladeuil
Test that the sphinx texinfo extension is loaded. |
34 |
in conf.extensions) |
35 |
||
|
5193.6.26
by Vincent Ladeuil
Separate builder and writer tests. |
36 |
class TestBuilderLoaded(test_dg.TestSphinx): |
|
5193.6.6
by Vincent Ladeuil
The right files are generated. |
37 |
|
38 |
def test_builder_loaded(self): |
|
39 |
app, out, err = self.make_sphinx() |
|
|
5193.6.4
by Vincent Ladeuil
Test that the sphinx texinfo extension is loaded. |
40 |
self.assertTrue('texinfo' in app.builderclasses) |
|
5193.6.6
by Vincent Ladeuil
The right files are generated. |
41 |
|
42 |
||
|
5193.6.26
by Vincent Ladeuil
Separate builder and writer tests. |
43 |
class TestFileProduction(test_dg.TestSphinx): |
|
5193.6.12
by Vincent Ladeuil
Implement a basic toctree generation. |
44 |
|
45 |
def test_files_generated(self): |
|
|
5563.1.1
by Vincent Ladeuil
Skip tests that don't support newer sphinx versions |
46 |
if self.sphinx_version() >= (1, 0): |
47 |
raise tests.TestSkipped('Not compatible with sphinx >= 1.0') |
|
|
5193.6.12
by Vincent Ladeuil
Implement a basic toctree generation. |
48 |
self.build_tree_contents( |
49 |
[('index.txt', """ |
|
50 |
Table of Contents
|
|
51 |
=================
|
|
52 |
||
53 |
.. toctree::
|
|
54 |
:maxdepth: 1
|
|
55 |
||
56 |
content
|
|
57 |
"""), |
|
58 |
('content.txt', """ |
|
59 |
||
60 |
bzr 0.0.8
|
|
61 |
*********
|
|
62 |
||
63 |
Improvements
|
|
64 |
============
|
|
65 |
||
66 |
* Adding a file whose parent directory is not versioned will
|
|
67 |
implicitly add the parent, and so on up to the root.
|
|
68 |
"""), |
|
69 |
])
|
|
70 |
app, out, err = self.make_sphinx() |
|
|
5193.6.20
by Vincent Ladeuil
Refactor tests. |
71 |
self.build(app) |
|
5193.6.12
by Vincent Ladeuil
Implement a basic toctree generation. |
72 |
self.failUnlessExists('index.texi') |
73 |
self.failUnlessExists('content.texi') |