~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-03-13 09:07:18 UTC
  • mfrom: (6437.23.26 2.5)
  • mto: This revision was merged to the branch mainline in revision 6499.
  • Revision ID: v.ladeuil+lp@free.fr-20120313090718-2e5wf4d6otbh2k2r
Merge 2.5 branch including bugfix for #940164 and #944696

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
"""
20
20
 
21
21
 
22
 
import bzrlib
23
 
from bzrlib import config
24
 
from bzrlib.tests import TestCaseWithTransport
25
 
 
26
 
 
27
 
class TestHelp(TestCaseWithTransport):
 
22
from bzrlib import (
 
23
    config,
 
24
    i18n,
 
25
    tests,
 
26
    )
 
27
 
 
28
from bzrlib.tests.test_i18n import ZzzTranslations
 
29
 
 
30
 
 
31
class TestHelp(tests.TestCaseWithTransport):
28
32
 
29
33
    def test_help_basic(self):
30
34
        for cmd in ['--help', 'help', '-h', '-?']:
175
179
 
176
180
        self.assertEqual("'bzr c' is an alias for 'bzr cat'.\n",
177
181
                         self.run_bzr('help c')[0])
 
182
 
 
183
 
 
184
class TestTranslatedHelp(tests.TestCaseWithTransport):
 
185
    """Tests for display of translated help topics"""
 
186
 
 
187
    def setUp(self):
 
188
        super(TestTranslatedHelp, self).setUp()
 
189
        self.overrideAttr(i18n, '_translations', ZzzTranslations())
 
190
 
 
191
    def test_help_command_utf8(self):
 
192
        out, err = self.run_bzr(["help", "push"], encoding="utf-8")
 
193
        self.assertContainsRe(out, "zz\xc3\xa5{{:See also:")
 
194
 
 
195
    def test_help_switch_utf8(self):
 
196
        out, err = self.run_bzr(["push", "--help"], encoding="utf-8")
 
197
        self.assertContainsRe(out, "zz\xc3\xa5{{:See also:")
 
198
 
 
199
    def test_help_command_ascii(self):
 
200
        out, err = self.run_bzr(["help", "push"], encoding="ascii")
 
201
        self.assertContainsRe(out, "zz\\?{{:See also:")
 
202
 
 
203
    def test_help_switch_ascii(self):
 
204
        out, err = self.run_bzr(["push", "--help"], encoding="ascii")
 
205
        self.assertContainsRe(out, "zz\\?{{:See also:")