~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Vincent Ladeuil
  • Date: 2012-02-14 17:22:37 UTC
  • mfrom: (6466 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6468.
  • Revision ID: v.ladeuil+lp@free.fr-20120214172237-7dv7er3n4uy8d5m4
Merge trunk

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
22
23
from bzrlib import (
23
24
    debug,
24
25
    errors,
29
30
from bzrlib.directory_service import directories
30
31
from bzrlib.tests import (
31
32
    features,
 
33
    ssl_certs,
32
34
    TestCaseInTempDir,
33
35
    TestCaseWithMemoryTransport
34
36
)
452
454
        tests.TestCase.setUp(self)
453
455
        self.server = self.server_class()
454
456
        self.server.start_server()
 
457
        self.addCleanup(self.server.stop_server)
455
458
        # Ensure we don't clobber env
456
459
        self.overrideEnv('BZR_LP_XMLRPC_URL', None)
457
 
 
458
 
    def tearDown(self):
459
 
        self.server.stop_server()
460
 
        tests.TestCase.tearDown(self)
 
460
        # Ensure we use the right certificates for https.
 
461
        # FIXME: There should be a better way but the only alternative I can
 
462
        # think of involves carrying the ca_certs through the lp_registration
 
463
        # infrastructure to _urllib2_wrappers... -- vila 2012-01-20
 
464
        bzrlib.global_state.cmdline_overrides._from_cmdline(
 
465
            ['ssl.ca_certs=%s' % ssl_certs.build_path('ca.crt')])
461
466
 
462
467
    def set_canned_response(self, server, path):
463
468
        response_format = '''HTTP/1.1 200 OK\r