~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ui.py

  • Committer: Robert Collins
  • Date: 2010-06-21 22:29:38 UTC
  • mfrom: (5230.1.5 340394-encoding-option)
  • mto: This revision was merged to the branch mainline in revision 5317.
  • Revision ID: robertc@robertcollins.net-20100621222938-2ca4dybx3c55huhn
Polish and adjust news for Martin's output_encoding branch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from StringIO import StringIO
25
25
 
26
26
from bzrlib import (
 
27
    config,
27
28
    errors,
28
29
    remote,
29
30
    repository,
33
34
from bzrlib.symbol_versioning import (
34
35
    deprecated_in,
35
36
    )
36
 
from bzrlib.tests import test_progress
 
37
from bzrlib.tests import (
 
38
    fixtures,
 
39
    test_progress,
 
40
    )
37
41
from bzrlib.ui import text as _mod_ui_text
38
42
 
39
43
 
 
44
class TestUIConfiguration(tests.TestCaseWithTransport):
 
45
 
 
46
    def test_output_encoding_configuration(self):
 
47
        enc = fixtures.generate_unicode_encodings().next()
 
48
        config.GlobalConfig().set_user_option('output_encoding',
 
49
            enc)
 
50
        ui = tests.TestUIFactory(stdin=None,
 
51
            stdout=tests.StringIOWrapper(),
 
52
            stderr=tests.StringIOWrapper())
 
53
        os = ui.make_output_stream()
 
54
        self.assertEquals(os.encoding, enc)
 
55
 
 
56
 
40
57
class TestTextUIFactory(tests.TestCase):
41
58
 
42
59
    def test_text_factory_ascii_password(self):