~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_generate_docs.py

  • Committer: John Arbash Meinel
  • Date: 2009-06-12 18:05:15 UTC
  • mto: (4371.4.5 vila-better-heads)
  • mto: This revision was merged to the branch mainline in revision 4449.
  • Revision ID: john@arbash-meinel.com-20090612180515-t0cwbjsnve094oik
Add a failing test for handling nodes that are in the same linear chain.

It fails because the ancestry skipping causes us to miss the fact that the two nodes
are actually directly related. We could check at the beginning, as the 
code used to do, but I think that will be incomplete for the more-than-two
heads cases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2009, 2011 Canonical Ltd
 
1
# Copyright (C) 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
22
22
 
23
23
from cStringIO import StringIO
24
24
 
25
 
import bzrlib.commands
26
 
from bzrlib.tests import TestCase
 
25
from bzrlib.tests import TestCase, TestSkipped
27
26
 
28
27
 
29
28
class Options:
38
37
        self.sio = StringIO()
39
38
        self.options = Options()
40
39
        self.options.bzr_name = 'bzr'
41
 
        bzrlib.commands.install_bzr_command_hooks()
42
40
 
43
41
    def test_man_page(self):
44
 
        from bzrlib.doc_generate import autodoc_man
 
42
        try:
 
43
            from tools.doc_generate import autodoc_man
 
44
        except ImportError:
 
45
            raise TestSkipped('The package "tools" is not available to test.')
45
46
 
46
47
        autodoc_man.infogen(self.options, self.sio)
47
48
        self.assertNotEqual('', self.sio.getvalue())
48
49
 
49
50
    def test_rstx_man(self):
50
 
        from bzrlib.doc_generate import autodoc_rstx
 
51
        try:
 
52
            from tools.doc_generate import autodoc_rstx
 
53
        except ImportError:
 
54
            raise TestSkipped('The package "tools" is not available to test.')
51
55
 
52
56
        autodoc_rstx.infogen(self.options, self.sio)
53
57
        self.assertNotEqual('', self.sio.getvalue())