/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ui.py

  • Committer: Robert Collins
  • Date: 2010-07-04 06:22:11 UTC
  • mto: This revision was merged to the branch mainline in revision 5332.
  • Revision ID: robertc@robertcollins.net-20100704062211-tk9hw6bnsn5x47fm
``bzrlib.lsprof.profile`` will no longer silently generate bad threaded
profiles when concurrent profile requests are made. Instead the profile
requests will be serialised. Reentrant requests will now deadlock.
(Robert Collins)

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):
385
402
 
386
403
    def test_test_ui_factory_progress(self):
387
404
        # there's no output; we just want to make sure this doesn't crash -
388
 
        # see https://bugs.edge.launchpad.net/bzr/+bug/408201
 
405
        # see https://bugs.launchpad.net/bzr/+bug/408201
389
406
        ui = tests.TestUIFactory()
390
407
        pb = ui.nested_progress_bar()
391
408
        pb.update('hello')