~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Aaron Bentley
  • Date: 2008-03-06 20:52:40 UTC
  • mto: This revision was merged to the branch mainline in revision 3266.
  • Revision ID: aaron@aaronbentley.com-20080306205240-k0wt7gn9xzhwmo56
Clean up Launchpad directory service code

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007 Canonical Ltd
 
1
# Copyright (C) 2007, 2008 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
25
25
from bzrlib.directory_service import directories
26
26
from bzrlib.tests import TestCase, TestCaseWithMemoryTransport
27
27
from bzrlib.transport import get_transport
 
28
from bzrlib.plugins.launchpad import _register_directory
28
29
from bzrlib.plugins.launchpad.lp_indirect import (
29
30
    LaunchpadDirectory)
30
31
from bzrlib.plugins.launchpad.account import get_lp_login
177
178
            def look_up(self, name, url):
178
179
                if 'lp:///apt' == url:
179
180
                    return target_branch.base.rstrip('/')
180
 
                return '!!!'
 
181
                return '!unexpected look_up value!'
181
182
 
182
183
        directories.remove('lp:')
183
184
        directories.register('lp:', FooService, 'Map lp URLs to local urls')
 
185
        self.addCleanup(_register_directory)
184
186
        self.addCleanup(lambda: directories.remove('lp:'))
185
187
        transport = get_transport('lp:///apt')
186
188
        branch = Branch.open_from_transport(transport)