~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-09 04:24:02 UTC
  • mfrom: (4415.1.6 deprecation)
  • Revision ID: pqm@pqm.ubuntu.com-20090609042402-bmecxutc27lsgu91
(mbp) remove deprecated progress bar and weave code

Show diffs side-by-side

added added

removed removed

Lines of Context:
25
25
 
26
26
import bzrlib
27
27
import bzrlib.errors as errors
28
 
from bzrlib.progress import (
29
 
    DotsProgressBar,
30
 
    ProgressBarStack,
31
 
    ProgressTask,
32
 
    TTYProgressBar,
33
 
    )
34
28
from bzrlib.symbol_versioning import (
35
29
    deprecated_in,
36
30
    )
164
158
        pb2.finished()
165
159
        pb1.finished()
166
160
 
167
 
    def test_progress_stack(self):
168
 
        # test the progress bar stack which the default text factory
169
 
        # uses.
170
 
        stderr = StringIO()
171
 
        stdout = StringIO()
172
 
        # make a stack, which accepts parameters like a pb.
173
 
        stack = self.applyDeprecated(
174
 
            deprecated_in((1, 12, 0)),
175
 
            ProgressBarStack,
176
 
            to_file=stderr, to_messages_file=stdout)
177
 
        # but is not one
178
 
        self.assertFalse(getattr(stack, 'note', False))
179
 
        pb1 = stack.get_nested()
180
 
        pb2 = stack.get_nested()
181
 
        warnings, _ = self.callCatchWarnings(pb1.finished)
182
 
        self.assertEqual(len(warnings), 1)
183
 
        pb2.finished()
184
 
        pb1.finished()
185
 
        # the text ui factory never actually removes the stack once its setup.
186
 
        # we need to be able to nest again correctly from here.
187
 
        pb1 = stack.get_nested()
188
 
        pb2 = stack.get_nested()
189
 
        warnings, _ = self.callCatchWarnings(pb1.finished)
190
 
        self.assertEqual(len(warnings), 1)
191
 
        pb2.finished()
192
 
        pb1.finished()
193
 
 
194
161
    def assert_get_bool_acceptance_of_user_input(self, factory):
195
162
        factory.stdin = StringIO("y\nyes with garbage\n"
196
163
                                 "yes\nn\nnot an answer\n"