~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_remote.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-10-15 21:44:44 UTC
  • mfrom: (3777.1.7 ssh-authconfig)
  • Revision ID: pqm@pqm.ubuntu.com-20081015214444-ztwoizx180edy73v
Enable specifying default ssh username in authentication.conf

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from cStringIO import StringIO
28
28
 
29
29
from bzrlib import (
 
30
    config,
30
31
    errors,
31
32
    graph,
32
33
    pack,
49
50
from bzrlib.symbol_versioning import one_four
50
51
from bzrlib.transport import get_transport, http
51
52
from bzrlib.transport.memory import MemoryTransport
52
 
from bzrlib.transport.remote import RemoteTransport, RemoteTCPTransport
 
53
from bzrlib.transport.remote import (
 
54
    RemoteTransport,
 
55
    RemoteSSHTransport,
 
56
    RemoteTCPTransport,
 
57
)
53
58
 
54
59
 
55
60
class BasicRemoteObjectTests(tests.TestCaseWithTransport):
1014
1019
            client._calls)
1015
1020
 
1016
1021
 
 
1022
class TestRemoteSSHTransportAuthentication(tests.TestCaseInTempDir):
 
1023
 
 
1024
    def test_defaults_to_none(self):
 
1025
        t = RemoteSSHTransport('bzr+ssh://example.com')
 
1026
        self.assertIs(None, t._get_credentials()[0])
 
1027
 
 
1028
    def test_uses_authentication_config(self):
 
1029
        conf = config.AuthenticationConfig()
 
1030
        conf._get_config().update(
 
1031
            {'bzr+sshtest': {'scheme': 'ssh', 'user': 'bar', 'host':
 
1032
            'example.com'}})
 
1033
        conf._save()
 
1034
        t = RemoteSSHTransport('bzr+ssh://example.com')
 
1035
        self.assertEqual('bar', t._get_credentials()[0])
 
1036
 
 
1037
 
1017
1038
class TestRemoteRepository(tests.TestCase):
1018
1039
    """Base for testing RemoteRepository protocol usage.
1019
1040