~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_ui.py

  • Committer: Martin Pool
  • Date: 2010-01-15 03:29:33 UTC
  • mto: This revision was merged to the branch mainline in revision 4967.
  • Revision ID: mbp@sourcefrog.net-20100115032933-5laj6tbzh4nx7o2r
trace quietness now controls whether the progress bar appears

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2008, 2009 Canonical Ltd
 
1
# Copyright (C) 2005, 2008, 2009, 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
248
248
        finally:
249
249
            pb.finished()
250
250
 
 
251
    def test_quietness(self):
 
252
        os.environ['BZR_PROGRESS_BAR'] = 'text'
 
253
        ui_factory = _mod_ui_text.TextUIFactory(None,
 
254
            test_progress._TTYStringIO(),
 
255
            test_progress._TTYStringIO())
 
256
        self.assertIsInstance(ui_factory._progress_view,
 
257
            _mod_ui_text.TextProgressView)
 
258
        ui_factory.be_quiet(True)
 
259
        self.assertIsInstance(ui_factory._progress_view,
 
260
            _mod_ui_text.NullProgressView)
 
261
 
251
262
 
252
263
class TestTextUIOutputStream(tests.TestCase):
253
264
    """Tests for output stream that synchronizes with progress bar."""