~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils_encodings.py

  • Committer: Vincent Ladeuil
  • Date: 2010-06-29 16:21:13 UTC
  • mfrom: (5325 +trunk)
  • mto: (5247.1.12 first-try)
  • mto: This revision was merged to the branch mainline in revision 5326.
  • Revision ID: v.ladeuil+lp@free.fr-20100629162113-xa6y33u17mfi024v
Merge bzr.dev into cleanup resolving conflicts

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006 Canonical Ltd
 
1
# Copyright (C) 2006-2010 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
114
114
        # and in the worst case, use osutils.get_user_encoding()
115
115
        self.assertEqual('user_encoding', osutils.get_terminal_encoding())
116
116
 
 
117
    def test_get_terminal_encoding_silent(self):
 
118
        self.make_wrapped_streams('stdout_encoding',
 
119
                                  'stderr_encoding',
 
120
                                  'stdin_encoding')
 
121
        # Calling get_terminal_encoding should not mutter when silent=True is
 
122
        # passed.
 
123
        log = self.get_log()
 
124
        osutils.get_terminal_encoding()
 
125
        self.assertEqual(log, self.get_log())
 
126
 
 
127
    def test_get_terminal_encoding_trace(self):
 
128
        self.make_wrapped_streams('stdout_encoding',
 
129
                                  'stderr_encoding',
 
130
                                  'stdin_encoding')
 
131
        # Calling get_terminal_encoding should not mutter when silent=True is
 
132
        # passed.
 
133
        log = self.get_log()
 
134
        osutils.get_terminal_encoding(trace=True)
 
135
        self.assertNotEqual(log, self.get_log())
 
136
 
117
137
    def test_terminal_cp0(self):
118
138
        # test cp0 encoding (Windows returns cp0 when there is no encoding)
119
139
        self.make_wrapped_streams('cp0',