~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/__init__.py

  • Committer: Robert J. Tanner
  • Date: 2009-04-08 03:34:31 UTC
  • mfrom: (4266 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4267.
  • Revision ID: tanner@real-time.com-20090408033431-draj0u7nd9bbby53
Merge 1.14rc1 back bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
675
675
    Allows get_password to be tested without real tty attached.
676
676
    """
677
677
 
678
 
    def __init__(self,
679
 
                 stdout=None,
680
 
                 stderr=None,
681
 
                 stdin=None):
682
 
        super(TestUIFactory, self).__init__()
 
678
    def __init__(self, stdout=None, stderr=None, stdin=None):
683
679
        if stdin is not None:
684
680
            # We use a StringIOWrapper to be able to test various
685
681
            # encodings, but the user is still responsible to
686
682
            # encode the string and to set the encoding attribute
687
683
            # of StringIOWrapper.
688
 
            self.stdin = StringIOWrapper(stdin)
689
 
        if stdout is None:
690
 
            self.stdout = sys.stdout
691
 
        else:
692
 
            self.stdout = stdout
693
 
        if stderr is None:
694
 
            self.stderr = sys.stderr
695
 
        else:
696
 
            self.stderr = stderr
 
684
            stdin = StringIOWrapper(stdin)
 
685
        super(TestUIFactory, self).__init__(stdin, stdout, stderr)
697
686
 
698
687
    def clear(self):
699
688
        """See progress.ProgressBar.clear()."""
701
690
    def clear_term(self):
702
691
        """See progress.ProgressBar.clear_term()."""
703
692
 
704
 
    def clear_term(self):
705
 
        """See progress.ProgressBar.clear_term()."""
706
 
 
707
693
    def finished(self):
708
694
        """See progress.ProgressBar.finished()."""
709
695
 
720
706
    def update(self, message, count=None, total=None):
721
707
        """See progress.ProgressBar.update()."""
722
708
 
723
 
    def get_non_echoed_password(self, prompt):
 
709
    def get_non_echoed_password(self):
724
710
        """Get password from stdin without trying to handle the echo mode"""
725
 
        if prompt:
726
 
            self.stdout.write(prompt.encode(self.stdout.encoding, 'replace'))
727
711
        password = self.stdin.readline()
728
712
        if not password:
729
713
            raise EOFError
1013
997
                raise AssertionError("%r is %r." % (left, right))
1014
998
 
1015
999
    def assertTransportMode(self, transport, path, mode):
1016
 
        """Fail if a path does not have mode mode.
 
1000
        """Fail if a path does not have mode "mode".
1017
1001
 
1018
1002
        If modes are not supported on this transport, the assertion is ignored.
1019
1003
        """
3350
3334
                   'bzrlib.tests.test_index',
3351
3335
                   'bzrlib.tests.test_info',
3352
3336
                   'bzrlib.tests.test_inv',
 
3337
                   'bzrlib.tests.test_inventory_delta',
3353
3338
                   'bzrlib.tests.test_knit',
3354
3339
                   'bzrlib.tests.test_lazy_import',
3355
3340
                   'bzrlib.tests.test_lazy_regex',
3394
3379
                   'bzrlib.tests.test_rules',
3395
3380
                   'bzrlib.tests.test_sampler',
3396
3381
                   'bzrlib.tests.test_selftest',
 
3382
                   'bzrlib.tests.test_serializer',
3397
3383
                   'bzrlib.tests.test_setup',
3398
3384
                   'bzrlib.tests.test_sftp_transport',
3399
3385
                   'bzrlib.tests.test_shelf',