/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: Andrew Bennetts
  • Date: 2009-10-21 11:13:40 UTC
  • mto: This revision was merged to the branch mainline in revision 4762.
  • Revision ID: andrew.bennetts@canonical.com-20091021111340-w7x4d5yf83qwjncc
Add test that WSGI glue allows request handlers to access paths above that request's. backing transport, so long as it is within the WSGI app's backing transport.

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)