~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ui.py

  • Committer: Vincent Ladeuil
  • Date: 2009-06-17 16:37:11 UTC
  • mfrom: (4454 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4466.
  • Revision ID: v.ladeuil+lp@free.fr-20090617163711-iqubyv0tlqr8ayvl
Merge trunk@4454

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()