~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils.py

  • Committer: Parth Malwankar
  • Date: 2010-09-24 12:53:00 UTC
  • mfrom: (5443 +trunk)
  • mto: This revision was merged to the branch mainline in revision 5444.
  • Revision ID: parth.malwankar@gmail.com-20100924125300-70sg2t3q03bcuqpm
merged trunk and moved NEWS entry to correct section

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())