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

  • Committer: Martin Pool
  • Date: 2009-08-03 05:49:46 UTC
  • mto: This revision was merged to the branch mainline in revision 4583.
  • Revision ID: mbp@sourcefrog.net-20090803054946-jc4iipuox950kwcr
TestUIFactory no longer needs to pretend to be its own ProgressView

Show diffs side-by-side

added added

removed removed

Lines of Context:
102
102
                          TestLoader,
103
103
                          )
104
104
from bzrlib.tests.treeshape import build_tree_contents
 
105
from bzrlib.ui import NullProgressView
105
106
from bzrlib.ui.text import TextUIFactory
106
107
import bzrlib.version_info_formats.format_custom
107
108
from bzrlib.workingtree import WorkingTree, WorkingTreeFormat2
709
710
    Hide the progress bar but emit note()s.
710
711
    Redirect stdin.
711
712
    Allows get_password to be tested without real tty attached.
 
713
 
 
714
    See also CannedInputUIFactory which lets you provide programmatic input in
 
715
    a structured way.
712
716
    """
 
717
    # XXX: Should probably unify more with CannedInputUIFactory or a
 
718
    # particular configuration of TextUIFactory, or otherwise have a clearer
 
719
    # idea of how they're supposed to be different.
713
720
 
714
721
    def __init__(self, stdout=None, stderr=None, stdin=None):
715
722
        if stdin is not None:
720
727
            stdin = StringIOWrapper(stdin)
721
728
        super(TestUIFactory, self).__init__(stdin, stdout, stderr)
722
729
 
723
 
    def clear(self):
724
 
        """See progress.ProgressBar.clear()."""
725
 
 
726
 
    def clear_term(self):
727
 
        """See progress.ProgressBar.clear_term()."""
728
 
 
729
 
    def finished(self):
730
 
        """See progress.ProgressBar.finished()."""
731
 
 
732
 
    def note(self, fmt_string, *args):
733
 
        """See progress.ProgressBar.note()."""
734
 
        if args:
735
 
            fmt_string = fmt_string % args
736
 
        self.stdout.write(fmt_string + "\n")
737
 
 
738
 
    def progress_bar(self):
739
 
        return self
740
 
 
741
 
    def nested_progress_bar(self):
742
 
        return self
 
730
    def make_progress_view(self):
 
731
        return NullProgressView()
743
732
 
744
733
    def update(self, message, count=None, total=None):
745
734
        """See progress.ProgressBar.update()."""