/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-04 04:07:13 UTC
  • mfrom: (4583 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4584.
  • Revision ID: mbp@sourcefrog.net-20090804040713-3n34fu7bfk8q41uo
merge trunk

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
731
732
    Hide the progress bar but emit note()s.
732
733
    Redirect stdin.
733
734
    Allows get_password to be tested without real tty attached.
 
735
 
 
736
    See also CannedInputUIFactory which lets you provide programmatic input in
 
737
    a structured way.
734
738
    """
735
739
    # TODO: Capture progress events at the model level and allow them to be
736
740
    # observed by tests that care.
 
741
    #
 
742
    # XXX: Should probably unify more with CannedInputUIFactory or a
 
743
    # particular configuration of TextUIFactory, or otherwise have a clearer
 
744
    # idea of how they're supposed to be different.
 
745
    # See https://bugs.edge.launchpad.net/bzr/+bug/408213
737
746
 
738
747
    def __init__(self, stdout=None, stderr=None, stdin=None):
739
748
        if stdin is not None:
744
753
            stdin = StringIOWrapper(stdin)
745
754
        super(TestUIFactory, self).__init__(stdin, stdout, stderr)
746
755
 
747
 
    def clear(self):
748
 
        """See progress.ProgressBar.clear()."""
749
 
 
750
 
    def clear_term(self):
751
 
        """See progress.ProgressBar.clear_term()."""
752
 
 
753
 
    def finished(self):
754
 
        """See progress.ProgressBar.finished()."""
755
 
 
756
 
    def note(self, fmt_string, *args):
757
 
        """See progress.ProgressBar.note()."""
758
 
        if args:
759
 
            fmt_string = fmt_string % args
760
 
        self.stdout.write(fmt_string + "\n")
761
 
 
762
 
    def progress_bar(self):
763
 
        return self
764
 
 
765
 
    def nested_progress_bar(self):
766
 
        return self
 
756
    def make_progress_view(self):
 
757
        return NullProgressView()
767
758
 
768
759
    def update(self, message, count=None, total=None):
769
760
        """See progress.ProgressBar.update()."""