28
from bzrlib.tests.test_i18n import ZzzTranslations
31
class TestHelp(tests.TestCaseWithTransport):
23
from bzrlib import config
24
from bzrlib.tests import TestCaseWithTransport
27
class TestHelp(TestCaseWithTransport):
33
29
def test_help_basic(self):
34
30
for cmd in ['--help', 'help', '-h', '-?']:
180
176
self.assertEqual("'bzr c' is an alias for 'bzr cat'.\n",
181
177
self.run_bzr('help c')[0])
184
class TestTranslatedHelp(tests.TestCaseWithTransport):
185
"""Tests for display of translated help topics"""
188
super(TestTranslatedHelp, self).setUp()
189
self.overrideAttr(i18n, '_translations', ZzzTranslations())
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:")
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:")
199
def test_help_command_ascii(self):
200
out, err = self.run_bzr(["help", "push"], encoding="ascii")
201
self.assertContainsRe(out, "zz\\?{{:See also:")
203
def test_help_switch_ascii(self):
204
out, err = self.run_bzr(["push", "--help"], encoding="ascii")
205
self.assertContainsRe(out, "zz\\?{{:See also:")