~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Ian Clatworthy
  • Date: 2007-08-28 23:43:50 UTC
  • mfrom: (2743.2.6 133548)
  • mto: This revision was merged to the branch mainline in revision 2763.
  • Revision ID: ian.clatworthy@internode.on.net-20070828234350-x3yya3jnx7p7o9xn
(Daniel Watkins) teach bzr help to recognize aliases

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
import bzrlib
23
23
from bzrlib.tests.blackbox import ExternalBase
 
24
from bzrlib.config import (ensure_config_dir_exists, config_filename)
24
25
 
25
26
 
26
27
class TestHelp(ExternalBase):
126
127
            if '--long' in line:
127
128
                self.assertContainsRe(line,
128
129
                    r'Show help on all commands\.')
 
130
 
 
131
    def test_help_with_aliases(self):
 
132
        original = self.run_bzr('help cat')[0]
 
133
 
 
134
        ensure_config_dir_exists()
 
135
        CONFIG=("[ALIASES]\n"
 
136
        "c=cat\n"
 
137
        "cat=cat\n")
 
138
 
 
139
        open(config_filename(),'wb').write(CONFIG)
 
140
 
 
141
        expected = original + "'bzr cat' is an alias for 'bzr cat'.\n"
 
142
        self.assertEqual(expected, self.run_bzr('help cat')[0])
 
143
 
 
144
        self.assertEqual("'bzr c' is an alias for 'bzr cat'.\n",
 
145
                         self.run_bzr('help c')[0])