~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Patch Queue Manager
  • Date: 2012-02-14 18:29:43 UTC
  • mfrom: (6404.6.11 cached-branch-store)
  • Revision ID: pqm@pqm.ubuntu.com-20120214182943-vso6j0mqdnxfkp7s
(vila) Cache the branch config store to avoid useless IOs. (Vincent Ladeuil)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009, 2010 Canonical Ltd
 
1
# Copyright (C) 2009, 2010, 2012 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
51
51
 
52
52
    def test_launchpad_branch_with_public_location(self):
53
53
        branch = self.make_branch('lp')
54
 
        branch.set_public_branch(
55
 
            'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
 
54
        branch.set_public_branch('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
56
55
        self.assertEqual(
57
56
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
58
57
             'browser'],
60
59
 
61
60
    def test_launchpad_branch_with_public_and_push_location(self):
62
61
        branch = self.make_branch('lp')
63
 
        branch.set_public_branch(
64
 
            'bzr+ssh://bazaar.launchpad.net/~foo/bar/public')
65
 
        branch.set_push_location(
66
 
            'bzr+ssh://bazaar.launchpad.net/~foo/bar/push')
 
62
        branch.lock_write()
 
63
        try:
 
64
            branch.set_public_branch(
 
65
                'bzr+ssh://bazaar.launchpad.net/~foo/bar/public')
 
66
            branch.set_push_location(
 
67
                'bzr+ssh://bazaar.launchpad.net/~foo/bar/push')
 
68
        finally:
 
69
            branch.unlock()
67
70
        self.assertEqual(
68
71
            ['Opening https://code.launchpad.net/~foo/bar/public in web '
69
72
             'browser'],
73
76
        # lp-open falls back to the push location if it cannot find a public
74
77
        # location.
75
78
        branch = self.make_branch('lp')
76
 
        branch.set_push_location(
77
 
            'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
 
79
        branch.set_push_location('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
78
80
        self.assertEqual(
79
81
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
80
82
             'browser'],