/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-06-30 23:11:39 UTC
  • mfrom: (6973.12.13 python3-k)
  • Revision ID: breezy.the.bot@gmail.com-20180630231139-tf5t5khh6bu5ntpm
Fix some more tests on python3.

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

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
 
            ['brz: ERROR: . is not registered on Launchpad.'],
 
35
            [b'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
 
            ['brz: ERROR: not-public is not registered on Launchpad.'],
 
41
            [b'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
 
            ['brz: ERROR: %s is not registered on Launchpad.' % url],
 
49
            [b'brz: ERROR: %s is not registered on Launchpad.' %
 
50
                url.encode('ascii')],
50
51
            self.run_open('non-lp', retcode=3))
51
52
 
52
53
    def test_launchpad_branch_with_public_location(self):
53
54
        branch = self.make_branch('lp')
54
55
        branch.set_public_branch('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
55
56
        self.assertEqual(
56
 
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
57
 
             'browser'],
 
57
            [b'Opening https://code.launchpad.net/~foo/bar/baz in web '
 
58
             b'browser'],
58
59
            self.run_open('lp'))
59
60
 
60
61
    def test_launchpad_branch_with_public_and_push_location(self):
68
69
        finally:
69
70
            branch.unlock()
70
71
        self.assertEqual(
71
 
            ['Opening https://code.launchpad.net/~foo/bar/public in web '
72
 
             'browser'],
 
72
            [b'Opening https://code.launchpad.net/~foo/bar/public in web '
 
73
             b'browser'],
73
74
            self.run_open('lp'))
74
75
 
75
76
    def test_launchpad_branch_with_no_public_but_with_push(self):
78
79
        branch = self.make_branch('lp')
79
80
        branch.set_push_location('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
80
81
        self.assertEqual(
81
 
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
82
 
             'browser'],
 
82
            [b'Opening https://code.launchpad.net/~foo/bar/baz in web '
 
83
             b'browser'],
83
84
            self.run_open('lp'))
84
85
 
85
86
    def test_launchpad_branch_with_no_public_no_push(self):
87
88
        # location and no push location, then just try to look up the
88
89
        # Launchpad page for that URL.
89
90
        self.assertEqual(
90
 
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
91
 
             'browser'],
 
91
            [b'Opening https://code.launchpad.net/~foo/bar/baz in web '
 
92
             b'browser'],
92
93
            self.run_open('bzr+ssh://bazaar.launchpad.net/~foo/bar/baz'))
93
94
 
94
95
    def test_launchpad_branch_subdirectory(self):
98
99
            'bzr+ssh://bazaar.launchpad.net/~foo/bar/baz')
99
100
        self.build_tree(['lp/a/'])
100
101
        self.assertEqual(
101
 
            ['Opening https://code.launchpad.net/~foo/bar/baz in web '
102
 
             'browser'],
 
102
            [b'Opening https://code.launchpad.net/~foo/bar/baz in web '
 
103
             b'browser'],
103
104
            self.run_open('.', working_dir='lp/a'))