~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_sftp_transport.py

  • Committer: Robert J. Tanner
  • Date: 2009-04-29 05:53:21 UTC
  • mfrom: (4311 +trunk)
  • mto: This revision was merged to the branch mainline in revision 4312.
  • Revision ID: tanner@real-time.com-20090429055321-v2s5l1mgki9f6cgn
[merge] 1.14 back to trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
    errors,
34
34
    tests,
35
35
    transport as _mod_transport,
 
36
    ui,
36
37
    )
37
38
from bzrlib.osutils import (
38
39
    pathjoin,
546
547
    def test_sftp_is_none_if_no_config(self):
547
548
        t = self.get_transport_for_connection(set_config=False)
548
549
        self.assertIs(None, t._get_credentials()[0])
 
550
 
 
551
    def test_sftp_doesnt_prompt_username(self):
 
552
        stdout = tests.StringIOWrapper()
 
553
        ui.ui_factory = tests.TestUIFactory(stdin='joe\nfoo\n', stdout=stdout)
 
554
        t = self.get_transport_for_connection(set_config=False)
 
555
        self.assertIs(None, t._get_credentials()[0])
 
556
        # No prompts should've been printed, stdin shouldn't have been read
 
557
        self.assertEquals("", stdout.getvalue())
 
558
        self.assertEquals(0, ui.ui_factory.stdin.tell())