~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: John Arbash Meinel
  • Date: 2010-02-17 17:11:16 UTC
  • mfrom: (4797.2.17 2.1)
  • mto: (4797.2.18 2.1)
  • mto: This revision was merged to the branch mainline in revision 5055.
  • Revision ID: john@arbash-meinel.com-20100217171116-h7t9223ystbnx5h8
merge bzr.2.1 in preparation for NEWS entry.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2009 Canonical Ltd
 
1
# Copyright (C) 2009, 2010 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
21
21
 
22
22
class TestLaunchpadOpen(TestCaseWithTransport):
23
23
 
24
 
    def run_open(self, location, retcode=0):
25
 
        out, err = self.run_bzr(
26
 
            ['launchpad-open', '--dry-run', location], retcode=retcode)
 
24
    def run_open(self, location, retcode=0, working_dir='.'):
 
25
        out, err = self.run_bzr(['launchpad-open', '--dry-run', location],
 
26
                                retcode=retcode,
 
27
                                working_dir=working_dir)
27
28
        return err.splitlines()
28
29
 
29
30
    def test_non_branch(self):
87
88
            ['Opening https://code.edge.launchpad.net/~foo/bar/baz in web '
88
89
             'browser'],
89
90
            self.run_open('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz'))
 
91
 
 
92
    def test_launchpad_branch_subdirectory(self):
 
93
        # lp-open in a subdirectory of a registered branch should work
 
94
        wt = self.make_branch_and_tree('lp')
 
95
        wt.branch.set_push_location(
 
96
            'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
 
97
        self.build_tree(['lp/a/'])
 
98
        self.assertEqual(
 
99
            ['Opening https://code.edge.launchpad.net/~foo/bar/baz in web '
 
100
             'browser'],
 
101
            self.run_open('.', working_dir='lp/a'))