~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-04-09 23:12:55 UTC
  • mfrom: (3920.2.37 dpush)
  • Revision ID: pqm@pqm.ubuntu.com-20090409231255-o8w1g2q3igiyf8b2
(Jelmer) Add the dpush command.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import os
20
20
import sys
21
21
 
22
 
from bzrlib import (
23
 
    tests,
24
 
    )
25
 
 
26
 
 
27
 
class TestLocale(tests.TestCaseWithTransport):
 
22
from bzrlib.tests import TestCaseWithTransport, TestSkipped
 
23
 
 
24
 
 
25
class TestLocale(TestCaseWithTransport):
28
26
 
29
27
    def setUp(self):
30
28
        super(TestLocale, self).setUp()
31
29
 
32
30
        if sys.platform in ('win32',):
33
 
            raise tests.TestSkipped('Windows does not respond to the LANG'
34
 
                                    ' env variable')
 
31
            raise TestSkipped('Windows does not respond to the LANG'
 
32
                              ' env variable')
35
33
 
36
34
        tree = self.make_branch_and_tree('tree')
37
35
        self.build_tree(['tree/a'])
43
41
        self.tree = tree
44
42
 
45
43
    def test_log_C(self):
46
 
        self.disable_missing_extensions_warning()
47
44
        out, err = self.run_bzr_subprocess(
48
45
            '--no-aliases --no-plugins log -q --log-format=long tree',
49
46
               env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none',
64
61
            '--no-aliases --no-plugins log -q --log-format=long tree',
65
62
               env_changes={'LANG':'BOGUS', 'BZR_PROGRESS_BAR':'none',
66
63
                            'LC_ALL':None, 'LC_CTYPE':None, 'LANGUAGE':None})
67
 
        self.assertStartsWith(err, 'bzr: warning: unsupported locale setting')
 
64
        # XXX: This depends on the exact formatting of a locale.Error
 
65
        # as the first part of the string. It may be a little tempermental
 
66
        self.assertEqualDiff("""\
 
67
bzr: warning: unsupported locale setting
 
68
  bzr could not set the application locale.
 
69
  Although this should be no problem for bzr itself,
 
70
  it might cause problems with some plugins.
 
71
  To investigate the issue, look at the output
 
72
  of the locale(1p) tool available on POSIX systems.
 
73
bzr: warning: unsupported locale setting
 
74
  Could not determine what text encoding to use.
 
75
  This error usually means your Python interpreter
 
76
  doesn't support the locale set by $LANG (BOGUS)
 
77
  Continuing with ascii encoding.
 
78
""", err)
68
79
        self.assertEqualDiff("""\
69
80
------------------------------------------------------------
70
81
revno: 1