/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_ui.py

  • Committer: Martin Pool
  • Date: 2010-09-14 04:11:04 UTC
  • mto: This revision was merged to the branch mainline in revision 5423.
  • Revision ID: mbp@sourcefrog.net-20100914041104-8o5mrtlbasomtuy3
Move CapturingUIFactory out of per_workingtree tests into somewhere reusable

Show diffs side-by-side

added added

removed removed

Lines of Context:
39
39
    test_progress,
40
40
    )
41
41
from bzrlib.ui import text as _mod_ui_text
 
42
from bzrlib.ui.testsupport import (
 
43
    CapturingUIFactory,
 
44
    )
42
45
 
43
46
 
44
47
class TestUIConfiguration(tests.TestCaseWithTransport):
432
435
        self.assertIsNone('0', av)
433
436
        self.assertIsNone('on', av)
434
437
        self.assertIsNone('off', av)
 
438
 
 
439
 
 
440
class TestCapturingUI(tests.TestCase):
 
441
    """Test test-oriented UIFactory that records progress updates"""
 
442
 
 
443
    def test_nested_ignore_depth_beyond_one(self):
 
444
        # we only want to capture the first level out progress, not
 
445
        # want sub-components might do. So we have nested bars ignored.
 
446
        factory = CapturingUIFactory()
 
447
        pb1 = factory.nested_progress_bar()
 
448
        pb1.update('foo', 0, 1)
 
449
        pb2 = factory.nested_progress_bar()
 
450
        pb2.update('foo', 0, 1)
 
451
        pb2.finished()
 
452
        pb1.finished()
 
453
        self.assertEqual([("update", 0, 1, 'foo')], factory._calls)