~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ui.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2006-04-24 01:20:27 UTC
  • mfrom: (1681.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20060424012027-0017c749480ad462
Make TextUIFactory allow selection of the progress bar type.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
from StringIO import StringIO
22
22
import sys
23
23
 
24
 
 
 
24
import bzrlib
25
25
import bzrlib.errors as errors
26
26
from bzrlib.progress import TTYProgressBar, ProgressBarStack
27
27
from bzrlib.tests import TestCase
28
28
from bzrlib.ui import SilentUIFactory
29
29
from bzrlib.ui.text import TextUIFactory
30
30
 
 
31
 
31
32
class UITests(TestCase):
32
33
 
33
34
    def test_silent_factory(self):
107
108
        self.assertRaises(errors.MissingProgressBarFinish, pb1.finished)
108
109
        pb2.finished()
109
110
        pb1.finished()
 
111
 
 
112
    def test_text_factory_setting_progress_bar(self):
 
113
        # we should be able to choose the progress bar type used.
 
114
        factory = bzrlib.ui.text.TextUIFactory(
 
115
            bar_type=bzrlib.progress.DotsProgressBar)
 
116
        bar = factory.nested_progress_bar()
 
117
        bar.finished()
 
118
        self.assertIsInstance(bar, bzrlib.progress.DotsProgressBar)