~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2006-06-22 18:24:25 UTC
  • mfrom: (1803 +trunk)
  • mto: (1793.3.6 bundle-fixes)
  • mto: This revision was merged to the branch mainline in revision 1806.
  • Revision ID: john@arbash-meinel.com-20060622182425-6f45cb7acd587216
[merge] bzr.dev 1804 and fix conflicts.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import os
22
22
 
23
23
import bzrlib
 
24
import bzrlib.osutils as osutils
24
25
from bzrlib.tests import TestCaseInTempDir, TestSkipped
25
26
from bzrlib.trace import mutter, note
26
27
import bzrlib.urlutils as urlutils
52
53
        bzr = self.run_bzr
53
54
 
54
55
        fs_enc = sys.getfilesystemencoding()
 
56
        terminal_enc = osutils.get_terminal_encoding()
55
57
        fname = self.info['filename']
56
58
        dir_name = self.info['directory']
57
59
        for thing in [fname, dir_name]:
59
61
                thing.encode(fs_enc)
60
62
            except UnicodeEncodeError:
61
63
                raise TestSkipped(('Unable to represent path %r'
62
 
                                   ' in filesystem encoding %s')
 
64
                                   ' in filesystem encoding "%s"')
63
65
                                    % (thing, fs_enc))
 
66
            try:
 
67
                thing.encode(terminal_enc)
 
68
            except UnicodeEncodeError:
 
69
                raise TestSkipped(('Unable to represent path %r'
 
70
                                   ' in terminal encoding "%s"'
 
71
                                   ' (even though it is valid in'
 
72
                                   ' filesystem encoding "%s")')
 
73
                                   % (thing, terminal_enc, fs_enc))
64
74
 
65
75
        bzr('init')
66
76
        open('a', 'wb').write('foo\n')
208
218
        open('a', 'ab').write('more text\n')
209
219
        bzr('commit', '-m', 'mod a')
210
220
 
211
 
        pwd = os.getcwdu()
 
221
        pwd = osutils.getcwd()
212
222
 
213
223
        os.chdir(u'../' + dirname2)
214
224
        txt = bzr('pull')