~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils_encodings.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2010-05-07 11:50:28 UTC
  • mfrom: (5147.4.7 more-colo)
  • Revision ID: pqm@pqm.ubuntu.com-20100507115028-tuuxmnormm8oetw6
(vila, for jelmer) Pass the colocated branch name along in more places,
        add extra tests.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 Canonical Ltd
 
1
# Copyright (C) 2005, 2006 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
 
 
137
117
    def test_terminal_cp0(self):
138
118
        # test cp0 encoding (Windows returns cp0 when there is no encoding)
139
119
        self.make_wrapped_streams('cp0',