~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Alexander Belchenko
  • Date: 2007-09-04 11:00:30 UTC
  • mto: This revision was merged to the branch mainline in revision 2800.
  • Revision ID: bialix@ukr.net-20070904110030-pma21wbsylstkdnv
support for non-ascii BZR_HOME in show_version()

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
        pathjoin,
36
36
        )
37
37
from bzrlib.tests import (
 
38
        probe_unicode_in_user_encoding,
38
39
        StringIOWrapper,
39
40
        TestCase,
40
41
        TestCaseInTempDir,
1001
1002
        
1002
1003
        So Unicode strings must be encoded.
1003
1004
        """
1004
 
        # Try a few different characters, to see if we can get
1005
 
        # one that will be valid in the user_encoding
1006
 
        possible_vals = [u'm\xb5', u'\xe1', u'\u0410']
1007
 
        for uni_val in possible_vals:
1008
 
            try:
1009
 
                env_val = uni_val.encode(bzrlib.user_encoding)
1010
 
            except UnicodeEncodeError:
1011
 
                # Try a different character
1012
 
                pass
1013
 
            else:
1014
 
                break
1015
 
        else:
 
1005
        uni_val, env_val = probe_unicode_in_user_encoding()
 
1006
        if uni_val is None:
1016
1007
            raise TestSkipped('Cannot find a unicode character that works in'
1017
1008
                              ' encoding %s' % (bzrlib.user_encoding,))
1018
1009