~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_osutils_encodings.py

  • Committer: Martin Packman
  • Date: 2012-01-05 10:37:58 UTC
  • mto: This revision was merged to the branch mainline in revision 6427.
  • Revision ID: martin.packman@canonical.com-20120105103758-wzftnmsip5iv9n2g
Revert addition of get_message_encoding function

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
"""Tests for the osutils wrapper."""
18
18
 
19
19
import codecs
20
 
import errno
21
20
import locale
22
 
import os
23
21
import sys
24
22
 
25
23
from bzrlib import (
202
200
        self._encoding = ''
203
201
        self.assertEquals('ascii', osutils.get_user_encoding())
204
202
        self.assertEquals('', sys.stderr.getvalue())
205
 
 
206
 
 
207
 
class TestMessageEncoding(TestCase):
208
 
    """Tests for getting the encoding used by system messages"""
209
 
 
210
 
    def test_get_message_encoding(self):
211
 
        encoding_name = osutils.get_message_encoding()
212
 
        "".decode(encoding_name) # should be a valid encoding name
213
 
 
214
 
    def test_get_message_encoding_decodes_strerror(self):
215
 
        encoding_name = osutils.get_message_encoding()
216
 
        for number, name in errno.errorcode.iteritems():
217
 
            string = os.strerror(number)
218
 
            string.decode(encoding_name)