/breezy/unstable

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/unstable

« back to all changes in this revision

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

  • Committer: Jelmer Vernooij
  • Date: 2017-05-24 01:39:33 UTC
  • mfrom: (3815.3776.6)
  • Revision ID: jelmer@jelmer.uk-20170524013933-ir4y4tqtrsiz2ka2
New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import os
20
20
import xmlrpclib
21
21
 
22
 
import bzrlib
23
 
from bzrlib import (
 
22
import breezy
 
23
from ... import (
24
24
    debug,
25
25
    errors,
26
26
    tests,
27
27
    transport,
28
28
    )
29
 
from bzrlib.branch import Branch
30
 
from bzrlib.directory_service import directories
31
 
from bzrlib.tests import (
 
29
from ...branch import Branch
 
30
from ...directory_service import directories
 
31
from ...tests import (
32
32
    features,
33
33
    ssl_certs,
34
34
    TestCaseInTempDir,
35
35
    TestCaseWithMemoryTransport
36
36
)
37
 
from bzrlib.plugins.launchpad import (
 
37
from . import (
38
38
    _register_directory,
39
39
    lp_registration,
40
40
    )
41
 
from bzrlib.plugins.launchpad.lp_directory import (
 
41
from .lp_directory import (
42
42
    LaunchpadDirectory)
43
 
from bzrlib.plugins.launchpad.account import get_lp_login, set_lp_login
44
 
from bzrlib.tests import http_server
45
 
 
46
 
 
47
 
def load_tests(standard_tests, module, loader):
 
43
from .account import get_lp_login, set_lp_login
 
44
from ...tests import http_server
 
45
 
 
46
 
 
47
def load_tests(loader, standard_tests, pattern):
48
48
    result = loader.suiteClass()
49
49
    t_tests, remaining_tests = tests.split_suite_by_condition(
50
50
        standard_tests, tests.condition_isinstance((
106
106
 
107
107
    def test_two_part_plus_subdir(self):
108
108
        # We allow you to pass more than just what resolves. That way you can
109
 
        # do things like "bzr log lp:apt/2.2/BUGS"
 
109
        # do things like "brz log lp:apt/2.2/BUGS"
110
110
        # Though the virtual FS implementation currently aborts when given a
111
111
        # URL like this, rather than letting you recurse upwards to find the
112
112
        # real branch at lp:apt/2.2
440
440
 
441
441
 
442
442
if features.HTTPSServerFeature.available():
443
 
    from bzrlib.tests import https_server
 
443
    from ...tests import https_server
444
444
    class PreCannedHTTPSServer(PreCannedServerMixin, https_server.HTTPSServer):
445
445
        pass
446
446
 
456
456
        self.server.start_server()
457
457
        self.addCleanup(self.server.stop_server)
458
458
        # Ensure we don't clobber env
459
 
        self.overrideEnv('BZR_LP_XMLRPC_URL', None)
 
459
        self.overrideEnv('BRZ_LP_XMLRPC_URL', None)
460
460
        # Ensure we use the right certificates for https.
461
461
        # FIXME: There should be a better way but the only alternative I can
462
462
        # think of involves carrying the ca_certs through the lp_registration
463
463
        # infrastructure to _urllib2_wrappers... -- vila 2012-01-20
464
 
        bzrlib.global_state.cmdline_overrides._from_cmdline(
 
464
        breezy.global_state.cmdline_overrides._from_cmdline(
465
465
            ['ssl.ca_certs=%s' % ssl_certs.build_path('ca.crt')])
466
466
 
467
467
    def set_canned_response(self, server, path):
497
497
                                                        path=path)
498
498
 
499
499
    def do_request(self, server_url):
500
 
        os.environ['BZR_LP_XMLRPC_URL'] = self.server.get_url()
 
500
        os.environ['BRZ_LP_XMLRPC_URL'] = self.server.get_url()
501
501
        service = lp_registration.LaunchpadService()
502
502
        resolve = lp_registration.ResolveLaunchpadPathRequest('bzr')
503
503
        result = resolve.submit(service)