~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-09-19 00:32:14 UTC
  • mfrom: (4685.2.1 bzr.dev)
  • Revision ID: pqm@pqm.ubuntu.com-20090919003214-2dli9jc4y5xhjj3n
(mbp for garyvdm) Revert rename of
        test_merge_uncommitted_otherbasis_ancestor_of_thisbasis.

Show diffs side-by-side

added added

removed removed

Lines of Context:
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)