/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Robert Collins
  • Date: 2007-07-15 15:40:37 UTC
  • mto: (2592.3.33 repository)
  • mto: This revision was merged to the branch mainline in revision 2624.
  • Revision ID: robertc@robertcollins.net-20070715154037-3ar8g89decddc9su
Make GraphIndex accept nodes as key, value, references, so that the method
signature is closer to what a simple key->value index delivers. Also
change the behaviour when the reference list count is zero to accept
key, value as nodes, and emit key, value to make it identical in that case
to a simple key->value index. This may not be a good idea, but for now it
seems ok.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#
13
13
# You should have received a copy of the GNU General Public License
14
14
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
15
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
16
 
17
17
"""Test that bzr handles locales in a reasonable way"""
18
18
 
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
 
        out, err = self.run_bzr_subprocess(
48
 
            '--no-aliases --no-plugins log -q --log-format=long tree',
 
44
        out, err = self.run_bzr_subprocess('--no-aliases', '--no-plugins',
 
45
               '-q', 'log', '--log-format=long', 'tree',
49
46
               env_changes={'LANG':'C', 'BZR_PROGRESS_BAR':'none',
50
47
                            'LC_ALL':None, 'LC_CTYPE':None, 'LANGUAGE':None})
51
48
        self.assertEqual('', err)
60
57
""", out)
61
58
 
62
59
    def test_log_BOGUS(self):
63
 
        out, err = self.run_bzr_subprocess(
64
 
            '--no-aliases --no-plugins log -q --log-format=long tree',
 
60
        out, err = self.run_bzr_subprocess('--no-aliases', '--no-plugins',
 
61
               '-q', 'log', '--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
  Could not determine what text encoding to use.
 
69
  This error usually means your Python interpreter
 
70
  doesn't support the locale set by $LANG (BOGUS)
 
71
  Continuing with ascii encoding.
 
72
""", err)
68
73
        self.assertEqualDiff("""\
69
74
------------------------------------------------------------
70
75
revno: 1