~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/plugins/launchpad/test_lp_indirect.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-12-05 02:40:11 UTC
  • mfrom: (3076.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20071205024011-bf20z11eucf3ltf1
Don't use sftp:// URLs as lp:/// translations when there's no Launchpad login. (Jonathan Lange)

Show diffs side-by-side

added added

removed removed

Lines of Context:
106
106
        self.assertEquals('http://bazaar.launchpad.net/~apt/apt/devel',
107
107
                          transport._resolve('lp:///apt', factory))
108
108
 
 
109
    def test_skip_sftp_launchpad_net_when_anonymous(self):
 
110
        # Test that sftp://bazaar.launchpad.net gets skipped if
 
111
        # Bazaar does not know the user's Launchpad ID:
 
112
        self.assertEqual(None, get_lp_login())
 
113
        factory = FakeResolveFactory(
 
114
            self, 'apt', dict(urls=[
 
115
                    'sftp://bazaar.launchpad.net/~apt/apt/devel',
 
116
                    'http://bazaar.launchpad.net/~apt/apt/devel']))
 
117
        transport = LaunchpadTransport('lp:///')
 
118
        self.assertEquals('http://bazaar.launchpad.net/~apt/apt/devel',
 
119
                          transport._resolve('lp:///apt', factory))
 
120
 
109
121
    def test_rewrite_bzr_ssh_launchpad_net(self):
110
122
        # Test that bzr+ssh URLs get rewritten to include the user's
111
123
        # Launchpad ID (assuming we know the Launchpad ID).