~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_progress.py

  • Committer: Andrew Bennetts
  • Date: 2010-07-29 11:17:57 UTC
  • mfrom: (5050.3.17 2.2)
  • mto: This revision was merged to the branch mainline in revision 5365.
  • Revision ID: andrew.bennetts@canonical.com-20100729111757-018h3pcefo7z0dnq
Merge lp:bzr/2.2 into lp:bzr.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2011 Canonical Ltd
 
1
# Copyright (C) 2006-2010 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
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
17
 
 
18
import os
18
19
from StringIO import StringIO
19
20
 
 
21
from bzrlib import errors
20
22
from bzrlib.progress import (
21
23
    ProgressTask,
22
24
    )
 
25
from bzrlib.symbol_versioning import (
 
26
    deprecated_in,
 
27
    )
23
28
from bzrlib.tests import TestCase
24
29
from bzrlib.ui.text import (
25
30
    TextProgressView,
65
70
        task.total_cnt = total
66
71
        return task
67
72
 
68
 
    def test_clear(self):
69
 
        # <https://bugs.launchpad.net/bzr/+bug/611127> clear must actually
70
 
        # send spaces to clear the line
71
 
        out, view = self.make_view()
72
 
        task = self.make_task(None, view, 'reticulating splines', 5, 20)
73
 
        view.show_progress(task)
74
 
        self.assertEqual(
75
 
'\r/ reticulating splines 5/20                                                    \r'
76
 
            , out.getvalue())
77
 
        view.clear()
78
 
        self.assertEqual(
79
 
'\r/ reticulating splines 5/20                                                    \r'
80
 
            + '\r' + 79 * ' ' + '\r',
81
 
            out.getvalue())
82
 
 
83
73
    def test_render_progress_no_bar(self):
84
74
        """The default view now has a spinner but no bar."""
85
75
        out, view = self.make_view()