~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Andrew Bennetts
  • Date: 2010-09-23 07:40:07 UTC
  • mfrom: (5050.17.24 2.2)
  • mto: This revision was merged to the branch mainline in revision 5440.
  • Revision ID: andrew.bennetts@canonical.com-20100923074007-bqk101393z4npbw0
MergeĀ lp:bzr/2.2.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import os
22
22
import re
23
23
import socket
24
 
import stat
25
24
import sys
26
25
import time
27
26
 
2076
2075
 
2077
2076
    def test_unicode_user(self):
2078
2077
        ue = osutils.get_user_encoding()
2079
 
        osutils.set_or_unset_env('LOGNAME', u'jrandom\xb6'.encode(ue))
2080
 
        self.assertEqual(u'jrandom\xb6', osutils.getuser_unicode())
 
2078
        uni_val, env_val = tests.probe_unicode_in_user_encoding()
 
2079
        if uni_val is None:
 
2080
            raise tests.TestSkipped(
 
2081
                'Cannot find a unicode character that works in encoding %s'
 
2082
                % (osutils.get_user_encoding(),))
 
2083
        uni_username = u'jrandom' + uni_val
 
2084
        encoded_username = uni_username.encode(ue)
 
2085
        osutils.set_or_unset_env('LOGNAME', encoded_username)
 
2086
        self.assertEqual(uni_username, osutils.getuser_unicode())