~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2016-02-01 19:13:13 UTC
  • mfrom: (6614.2.2 trunk)
  • Revision ID: pqm@pqm.ubuntu.com-20160201191313-wdfvmfff1djde6oq
(vila) Release 2.7.0 (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007-2011 Canonical Ltd
 
1
# Copyright (C) 2007-2012, 2016 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
229
229
            self, 'apt', dict(urls=[
230
230
                    'http://bazaar.launchpad.net/~apt/apt/devel']))
231
231
        directory = LaunchpadDirectory()
232
 
        self.assertEquals('http://bazaar.launchpad.net/~apt/apt/devel',
 
232
        self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel',
233
233
                          directory._resolve('lp:apt', factory))
234
234
        # Make sure that resolve went to the production server.
235
 
        self.assertEquals('https://xmlrpc.launchpad.net/bazaar/',
 
235
        self.assertEqual('https://xmlrpc.launchpad.net/bazaar/',
236
236
                          factory._service_url)
237
237
 
238
238
    def test_qastaging(self):
242
242
                    'http://bazaar.qastaging.launchpad.net/~apt/apt/devel']))
243
243
        url = 'lp://qastaging/apt'
244
244
        directory = LaunchpadDirectory()
245
 
        self.assertEquals('http://bazaar.qastaging.launchpad.net/~apt/apt/devel',
 
245
        self.assertEqual('http://bazaar.qastaging.launchpad.net/~apt/apt/devel',
246
246
                          directory._resolve(url, factory))
247
247
        # Make sure that resolve went to the qastaging server.
248
 
        self.assertEquals('https://xmlrpc.qastaging.launchpad.net/bazaar/',
 
248
        self.assertEqual('https://xmlrpc.qastaging.launchpad.net/bazaar/',
249
249
                          factory._service_url)
250
250
 
251
251
    def test_staging(self):
255
255
                    'http://bazaar.staging.launchpad.net/~apt/apt/devel']))
256
256
        url = 'lp://staging/apt'
257
257
        directory = LaunchpadDirectory()
258
 
        self.assertEquals('http://bazaar.staging.launchpad.net/~apt/apt/devel',
 
258
        self.assertEqual('http://bazaar.staging.launchpad.net/~apt/apt/devel',
259
259
                          directory._resolve(url, factory))
260
260
        # Make sure that resolve went to the staging server.
261
 
        self.assertEquals('https://xmlrpc.staging.launchpad.net/bazaar/',
 
261
        self.assertEqual('https://xmlrpc.staging.launchpad.net/bazaar/',
262
262
                          factory._service_url)
263
263
 
264
264
    def test_url_from_directory(self):
267
267
            self, 'apt', dict(urls=[
268
268
                    'http://bazaar.launchpad.net/~apt/apt/devel']))
269
269
        directory = LaunchpadDirectory()
270
 
        self.assertEquals('http://bazaar.launchpad.net/~apt/apt/devel',
 
270
        self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel',
271
271
                          directory._resolve('lp:///apt', factory))
272
272
 
273
273
    def test_directory_skip_bad_schemes(self):
277
277
                    'http://bazaar.launchpad.net/~apt/apt/devel',
278
278
                    'http://another/location']))
279
279
        directory = LaunchpadDirectory()
280
 
        self.assertEquals('http://bazaar.launchpad.net/~apt/apt/devel',
 
280
        self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel',
281
281
                          directory._resolve('lp:///apt', factory))
282
282
 
283
283
    def test_directory_no_matching_schemes(self):
309
309
                    'bzr+ssh://bazaar.launchpad.net/~apt/apt/devel',
310
310
                    'http://bazaar.launchpad.net/~apt/apt/devel']))
311
311
        directory = LaunchpadDirectory()
312
 
        self.assertEquals('http://bazaar.launchpad.net/~apt/apt/devel',
 
312
        self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel',
313
313
                          directory._resolve('lp:///apt', factory))
314
314
 
315
315
    def test_skip_sftp_launchpad_net_when_anonymous(self):
321
321
                    'sftp://bazaar.launchpad.net/~apt/apt/devel',
322
322
                    'http://bazaar.launchpad.net/~apt/apt/devel']))
323
323
        directory = LaunchpadDirectory()
324
 
        self.assertEquals('http://bazaar.launchpad.net/~apt/apt/devel',
 
324
        self.assertEqual('http://bazaar.launchpad.net/~apt/apt/devel',
325
325
                          directory._resolve('lp:///apt', factory))
326
326
 
327
327
    def test_with_login_avoid_resolve_factory(self):
332
332
                    'bzr+ssh://my-super-custom/special/devel',
333
333
                    'http://bazaar.launchpad.net/~apt/apt/devel']))
334
334
        directory = LaunchpadDirectory()
335
 
        self.assertEquals(
 
335
        self.assertEqual(
336
336
            'bzr+ssh://bazaar.launchpad.net/+branch/apt',
337
337
            directory._resolve('lp:///apt', factory, _lp_login='username'))
338
338
 
344
344
                    'bzr+ssh://example.com/~apt/apt/devel',
345
345
                    'http://bazaar.launchpad.net/~apt/apt/devel']))
346
346
        directory = LaunchpadDirectory()
347
 
        self.assertEquals('bzr+ssh://example.com/~apt/apt/devel',
 
347
        self.assertEqual('bzr+ssh://example.com/~apt/apt/devel',
348
348
                          directory._resolve('lp:///apt', factory))
349
349
 
350
350
    # TODO: check we get an error if the url is unreasonable
358
358
            self, '~username/apt/test', dict(urls=[
359
359
                'bzr+ssh://bazaar.launchpad.net/~username/apt/test']))
360
360
        directory = LaunchpadDirectory()
361
 
        self.assertEquals(
 
361
        self.assertEqual(
362
362
            'bzr+ssh://bazaar.launchpad.net/~username/apt/test',
363
363
            directory._resolve('lp:~/apt/test', factory, _lp_login='username'))
364
364
        # Should also happen when the login is just set by config
365
365
        set_lp_login('username')
366
 
        self.assertEquals(
 
366
        self.assertEqual(
367
367
            'bzr+ssh://bazaar.launchpad.net/~username/apt/test',
368
368
            directory._resolve('lp:~/apt/test', factory))
369
369
 
508
508
        result = self.do_request(self.server.get_url())
509
509
        urls = result.get('urls', None)
510
510
        self.assertIsNot(None, urls)
511
 
        self.assertEquals(
 
511
        self.assertEqual(
512
512
            ['bzr+ssh://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev',
513
513
             'http://bazaar.launchpad.net/~bzr-pqm/bzr/bzr.dev'],
514
514
            urls)