/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: Canonical.com Patch Queue Manager
  • Date: 2009-08-04 00:55:07 UTC
  • mfrom: (4580.2.4 408201-testuifactory)
  • Revision ID: pqm@pqm.ubuntu.com-20090804005507-h1qergam3ijkmvci
(mbp) Cleanup TestUIFactory; prevent pb.tick() failures

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
719
720
    Hide the progress bar but emit note()s.
720
721
    Redirect stdin.
721
722
    Allows get_password to be tested without real tty attached.
 
723
 
 
724
    See also CannedInputUIFactory which lets you provide programmatic input in
 
725
    a structured way.
722
726
    """
 
727
    # XXX: Should probably unify more with CannedInputUIFactory or a
 
728
    # particular configuration of TextUIFactory, or otherwise have a clearer
 
729
    # idea of how they're supposed to be different.
 
730
    # See https://bugs.edge.launchpad.net/bzr/+bug/408213
723
731
 
724
732
    def __init__(self, stdout=None, stderr=None, stdin=None):
725
733
        if stdin is not None:
730
738
            stdin = StringIOWrapper(stdin)
731
739
        super(TestUIFactory, self).__init__(stdin, stdout, stderr)
732
740
 
733
 
    def clear(self):
734
 
        """See progress.ProgressBar.clear()."""
735
 
 
736
 
    def clear_term(self):
737
 
        """See progress.ProgressBar.clear_term()."""
738
 
 
739
 
    def finished(self):
740
 
        """See progress.ProgressBar.finished()."""
741
 
 
742
 
    def note(self, fmt_string, *args):
743
 
        """See progress.ProgressBar.note()."""
744
 
        if args:
745
 
            fmt_string = fmt_string % args
746
 
        self.stdout.write(fmt_string + "\n")
747
 
 
748
 
    def progress_bar(self):
749
 
        return self
750
 
 
751
 
    def nested_progress_bar(self):
752
 
        return self
 
741
    def make_progress_view(self):
 
742
        return NullProgressView()
753
743
 
754
744
    def update(self, message, count=None, total=None):
755
745
        """See progress.ProgressBar.update()."""