~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: 2009-06-17 10:04:37 UTC
  • mfrom: (4449.2.6 339385-set-progress-bar)
  • Revision ID: pqm@pqm.ubuntu.com-20090617100437-gavn9zkum4dj5yjz
(mbp) resurrect BZR_PROGRESS_BAR

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    SilentUIFactory,
40
40
    )
41
41
from bzrlib.ui.text import (
 
42
    NullProgressView,
42
43
    TextProgressView,
43
44
    TextUIFactory,
44
45
    )
103
104
        finally:
104
105
            pb.finished()
105
106
 
 
107
    def test_progress_construction(self):
 
108
        """TextUIFactory constructs the right progress view.
 
109
        """
 
110
        os.environ['BZR_PROGRESS_BAR'] = 'none'
 
111
        self.assertIsInstance(TextUIFactory()._progress_view,
 
112
            NullProgressView)
 
113
 
 
114
        os.environ['BZR_PROGRESS_BAR'] = 'text'
 
115
        self.assertIsInstance(TextUIFactory()._progress_view,
 
116
            TextProgressView)
 
117
 
 
118
        os.environ['BZR_PROGRESS_BAR'] = 'text'
 
119
        self.assertIsInstance(TextUIFactory()._progress_view,
 
120
            TextProgressView)
 
121
 
 
122
        del os.environ['BZR_PROGRESS_BAR']
 
123
        self.assertIsInstance(TextUIFactory()._progress_view,
 
124
            TextProgressView)
 
125
 
106
126
    def test_progress_note(self):
107
127
        stderr = StringIO()
108
128
        stdout = StringIO()