~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_commands.py

Merge prerequisite branch and tweak test to be more compact and faster.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
from cStringIO import StringIO
18
18
import errno
 
19
import inspect
19
20
import sys
20
21
 
21
22
from bzrlib import (
33
34
 
34
35
class TestCommands(tests.TestCase):
35
36
 
 
37
    def test_all_commands_have_help(self):
 
38
        commands._register_builtin_commands()
 
39
        commands_without_help = set()
 
40
        base_doc = inspect.getdoc(commands.Command)
 
41
        for cmd_name in commands.all_command_names():
 
42
            cmd = commands.get_cmd_object(cmd_name)
 
43
            cmd_help = cmd.help()
 
44
            if not cmd_help or cmd_help == base_doc:
 
45
                commands_without_help.append(cmd_name)
 
46
        self.assertLength(0, commands_without_help)
 
47
 
36
48
    def test_display_command(self):
37
49
        """EPIPE message is selectively suppressed"""
38
50
        def pipe_thrower():