~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ui.py

Fixup pb usage to use nested_progress_bar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    def test_silent_factory(self):
34
34
 
35
35
        ui = SilentUIFactory()
36
 
        pb = ui.progress_bar()
37
 
        # TODO: Test that there is no output from SilentUIFactory
38
 
 
39
 
        self.assertEquals(ui.get_password(), None)
40
 
        self.assertEquals(ui.get_password(u'Hello There \u1234 %(user)s',
41
 
                                          user=u'some\u1234')
42
 
                         , None)
 
36
        pb = ui.nested_progress_bar()
 
37
        try:
 
38
            # TODO: Test that there is no output from SilentUIFactory
 
39
    
 
40
            self.assertEquals(ui.get_password(), None)
 
41
            self.assertEquals(ui.get_password(u'Hello There \u1234 %(user)s',
 
42
                                              user=u'some\u1234')
 
43
                             , None)
 
44
        finally:
 
45
            pb.finished()
43
46
 
44
47
    def test_text_factory(self):
45
48
        ui = TextUIFactory()
46
 
        pb = ui.progress_bar()
 
49
        pb = ui.nested_progress_bar()
 
50
        pb.finished()
47
51
        # TODO: Test the output from TextUIFactory, perhaps by overriding sys.stdout
48
52
 
49
53
        # Unfortunately we can't actually test the ui.get_password() because