/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_progress.py

  • Committer: Robert Collins
  • Date: 2009-08-26 03:20:32 UTC
  • mfrom: (4637 +trunk)
  • mto: (4634.6.2 2.0)
  • mto: This revision was merged to the branch mainline in revision 4660.
  • Revision ID: robertc@robertcollins.net-20090826032032-mx5kiog3eihaoy13
Merge and cherrypick outstanding 2.0 relevant patches from bzr.dev: Up to rev
4637, then 4639,4641,4643,4646,4649,4650,4651. (Robert Collins)

Log messages of the incorporated fixes:

revno: 4651 [merge]
  (robertc) Enable commit via record_iter_changes for specific file
        comments. (Robert Collins)

revno: 4650 [merge]
  Fix shelve on windows. (Robert Collins, #305006)

revno: 4649 [merge]
  (robertc) Make iter_changes produce output that is always safe to
        generate inventory deltas of in the same direction as the
        changes. (Robert Collins, #347649)

revno: 4646 [merge]
  (mbp) developer documentation about content filtering

revno: 4643 [merge]
  (mbp) small tweaks to release documentation

revno: 4641 [merge]
  (abentley) Shelve will not remove tree root.

revno: 4639 [merge]
  (andrew) Fix 'Revision ... not present' errors when upgrading stacked
        branches.

revno: 4637 [merge]
  Fix upgrade of branches in repositories.

revno: 4636 [merge]
  (mbp) fix crash formatting CannotBindAddress

revno: 4635 [merge]
  (robertc) Fix many locking errors on windows due to a small bug in
        merge.transform_tree. (Robert Collins)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006-2010 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
70
70
        task.total_cnt = total
71
71
        return task
72
72
 
73
 
    def test_render_progress_no_bar(self):
74
 
        """The default view now has a spinner but no bar."""
75
 
        out, view = self.make_view()
76
 
        # view.enable_bar = False
77
 
        task = self.make_task(None, view, 'reticulating splines', 5, 20)
78
 
        view.show_progress(task)
79
 
        self.assertEqual(
80
 
'\r/ reticulating splines 5/20                                                    \r'
81
 
            , out.getvalue())
82
 
 
83
73
    def test_render_progress_easy(self):
84
74
        """Just one task and one quarter done"""
85
75
        out, view = self.make_view()
86
 
        view.enable_bar = True
87
76
        task = self.make_task(None, view, 'reticulating splines', 5, 20)
88
77
        view.show_progress(task)
89
78
        self.assertEqual(
96
85
        task = self.make_task(None, view, 'reticulating splines', 0, 2)
97
86
        task2 = self.make_task(task, view, 'stage2', 1, 2)
98
87
        view.show_progress(task2)
99
 
        view.enable_bar = True
100
88
        # so we're in the first half of the main task, and half way through
101
89
        # that
102
90
        self.assertEqual(
112
100
    def test_render_progress_sub_nested(self):
113
101
        """Intermediate tasks don't mess up calculation."""
114
102
        out, view = self.make_view()
115
 
        view.enable_bar = True
116
103
        task_a = ProgressTask(None, progress_view=view)
117
104
        task_a.update('a', 0, 2)
118
105
        task_b = ProgressTask(task_a, progress_view=view)