~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_progress.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2009-01-23 18:14:16 UTC
  • mfrom: (3948.2.8 progress)
  • Revision ID: pqm@pqm.ubuntu.com-20090123181416-tku4gdtorboy6d0y
(mbp) further progress bar fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006, 2007 Canonical Ltd
 
1
# Copyright (C) 2006, 2007, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
27
27
        InstrumentedProgress,
28
28
        )
29
29
from bzrlib.tests import TestCase
 
30
from bzrlib.symbol_versioning import (
 
31
    deprecated_in,
 
32
    )
30
33
 
31
34
 
32
35
class FakeStack:
106
109
        self.check_stack(DummyProgress, DummyProgress)
107
110
 
108
111
    def check_stack(self, parent_class, child_class):
109
 
        stack = ProgressBarStack(klass=parent_class, to_file=StringIO())
 
112
        stack = self.applyDeprecated(
 
113
            deprecated_in((1, 12, 0)),
 
114
            ProgressBarStack,
 
115
            klass=parent_class, to_file=StringIO())
110
116
        parent = stack.get_nested()
111
117
        try:
112
118
            self.assertIs(parent.__class__, parent_class)
212
218
 
213
219
        self.addCleanup(reset)
214
220
 
215
 
        stack = ProgressBarStack(to_file=outf)
 
221
        stack = self.applyDeprecated(
 
222
            deprecated_in((1, 12, 0)),
 
223
            ProgressBarStack,
 
224
            to_file=outf)
216
225
        pb = stack.get_nested()
217
226
        pb.start_time -= 1 # Make sure it is ready to write
218
227
        pb.width = 20 # And it is of reasonable size