~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/blackbox/test_help.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-11-17 03:20:35 UTC
  • mfrom: (4792.4.3 456036)
  • Revision ID: pqm@pqm.ubuntu.com-20091117032035-s3sgtlixj1lrminn
(Gordon Tyler) Fix IndexError during 'bzr ignore /' (#456036)

Show diffs side-by-side

added added

removed removed

Lines of Context:
105
105
        self.assertEquals(dash_help, qmark_cmds)
106
106
 
107
107
    def test_hidden(self):
108
 
        help_commands = self.run_bzr('help commands')[0]
109
 
        help_hidden = self.run_bzr('help hidden-commands')[0]
110
 
 
111
 
        def extract_cmd_names(help_output):
112
 
            # keep only the command names to avoid matching on help text (there
113
 
            # is a high risk to fail a test when a plugin get installed
114
 
            # otherwise)
115
 
            cmds = []
116
 
            for line in help_output.split('\n'):
117
 
                if line.startswith(' '):
118
 
                    continue # help on more than one line
119
 
                cmd = line.split(' ')[0]
120
 
                if line:
121
 
                    cmds.append(cmd)
122
 
            return cmds
123
 
        commands = extract_cmd_names(help_commands)
124
 
        hidden = extract_cmd_names(help_hidden)
 
108
        commands = self.run_bzr('help commands')[0]
 
109
        hidden = self.run_bzr('help hidden-commands')[0]
125
110
        self.assertTrue('commit' in commands)
126
111
        self.assertTrue('commit' not in hidden)
127
112
        self.assertTrue('rocks' in hidden)