/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

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

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-07-15 12:30:05 UTC
  • mfrom: (7027.7.2 python3-launchpad)
  • Revision ID: breezy.the.bot@gmail.com-20180715123005-np70ia6s48fx1uy6
Fix all but 3 launchpad tests on python 3.

Merged from https://code.launchpad.net/~jelmer/brz/python3-launchpad/+merge/349620

Show diffs side-by-side

added added

removed removed

Lines of Context:
32
32
        # to guess the Launchpad page for the given URL / path. If it cannot
33
33
        # find one, it will raise an error.
34
34
        self.assertEqual(
35
 
            [b'brz: ERROR: . is not registered on Launchpad.'],
 
35
            ['brz: ERROR: . is not registered on Launchpad.'],
36
36
            self.run_open('.', retcode=3))
37
37
 
38
38
    def test_no_public_location_no_push_location(self):
39
39
        self.make_branch('not-public')
40
40
        self.assertEqual(
41
 
            [b'brz: ERROR: not-public is not registered on Launchpad.'],
 
41
            ['brz: ERROR: not-public is not registered on Launchpad.'],
42
42
            self.run_open('not-public', retcode=3))
43
43
 
44
44
    def test_non_launchpad_branch(self):
46
46
        url = 'http://example.com/non-lp'
47
47
        branch.set_public_branch(url)
48
48
        self.assertEqual(
49
 
            [b'brz: ERROR: %s is not registered on Launchpad.' %
50
 
                url.encode('ascii')],
 
49
            ['brz: ERROR: %s is not registered on Launchpad.' %
 
50
                url],
51
51
            self.run_open('non-lp', retcode=3))
52
52
 
53
53
    def test_launchpad_branch_with_public_location(self):
54
54
        branch = self.make_branch('lp')
55
55
        branch.set_public_branch('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
56
56
        self.assertEqual(
57
 
            [b'Opening https://code.launchpad.net/~foo/bar/baz in web '
58
 
             b'browser'],
 
57
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
 
58
             'browser'],
59
59
            self.run_open('lp'))
60
60
 
61
61
    def test_launchpad_branch_with_public_and_push_location(self):
69
69
        finally:
70
70
            branch.unlock()
71
71
        self.assertEqual(
72
 
            [b'Opening https://code.launchpad.net/~foo/bar/public in web '
73
 
             b'browser'],
 
72
            ['Opening https://code.launchpad.net/~foo/bar/public in web '
 
73
             'browser'],
74
74
            self.run_open('lp'))
75
75
 
76
76
    def test_launchpad_branch_with_no_public_but_with_push(self):
79
79
        branch = self.make_branch('lp')
80
80
        branch.set_push_location('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
81
81
        self.assertEqual(
82
 
            [b'Opening https://code.launchpad.net/~foo/bar/baz in web '
83
 
             b'browser'],
 
82
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
 
83
             'browser'],
84
84
            self.run_open('lp'))
85
85
 
86
86
    def test_launchpad_branch_with_no_public_no_push(self):
88
88
        # location and no push location, then just try to look up the
89
89
        # Launchpad page for that URL.
90
90
        self.assertEqual(
91
 
            [b'Opening https://code.launchpad.net/~foo/bar/baz in web '
92
 
             b'browser'],
 
91
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
 
92
             'browser'],
93
93
            self.run_open('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz'))
94
94
 
95
95
    def test_launchpad_branch_subdirectory(self):
99
99
            'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
100
100
        self.build_tree(['lp/a/'])
101
101
        self.assertEqual(
102
 
            [b'Opening https://code.launchpad.net/~foo/bar/baz in web '
103
 
             b'browser'],
 
102
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
 
103
             'browser'],
104
104
            self.run_open('.', working_dir='lp/a'))