/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/tests/blackbox/test_help.py

  • Committer: Jelmer Vernooij
  • Date: 2017-06-08 23:30:31 UTC
  • mto: This revision was merged to the branch mainline in revision 6690.
  • Revision ID: jelmer@jelmer.uk-20170608233031-3qavls2o7a1pqllj
Update imports.

Show diffs side-by-side

added added

removed removed

Lines of Context:
66
66
    def test_help_urlspec(self):
67
67
        """Smoke test for 'brz help urlspec'"""
68
68
        out, err = self.run_bzr('help urlspec')
 
69
        self.assertContainsRe(out, 'aftp://')
69
70
        self.assertContainsRe(out, 'bzr://')
70
 
        self.assertContainsRe(out, 'bzr\\+ssh://')
 
71
        self.assertContainsRe(out, 'bzr\+ssh://')
71
72
        self.assertContainsRe(out, 'file://')
 
73
        self.assertContainsRe(out, 'ftp://')
72
74
        self.assertContainsRe(out, 'http://')
73
75
        self.assertContainsRe(out, 'https://')
74
76
        self.assertContainsRe(out, 'sftp://')
95
97
        self.assertEqual(expected, out)
96
98
 
97
99
    def test_help_commands(self):
98
 
        dash_help = self.run_bzr('--help commands')[0]
99
 
        commands = self.run_bzr('help commands')[0]
 
100
        dash_help  = self.run_bzr('--help commands')[0]
 
101
        commands   = self.run_bzr('help commands')[0]
100
102
        hidden = self.run_bzr('help hidden-commands')[0]
101
 
        long_help = self.run_bzr('help --long')[0]
 
103
        long_help  = self.run_bzr('help --long')[0]
102
104
        qmark_long = self.run_bzr('? --long')[0]
103
105
        qmark_cmds = self.run_bzr('? commands')[0]
104
106
        self.assertEqual(dash_help, commands)
121
123
            cmds = []
122
124
            for line in help_output.split('\n'):
123
125
                if line.startswith(' '):
124
 
                    continue  # help on more than one line
 
126
                    continue # help on more than one line
125
127
                cmd = line.split(' ')[0]
126
128
                if line:
127
129
                    cmds.append(cmd)
134
136
        self.assertTrue('rocks' not in commands)
135
137
 
136
138
    def test_help_detail(self):
137
 
        dash_h = self.run_bzr('diff -h')[0]
138
 
        help_x = self.run_bzr('help diff')[0]
 
139
        dash_h  = self.run_bzr('diff -h')[0]
 
140
        help_x  = self.run_bzr('help diff')[0]
139
141
        self.assertEqual(dash_h, help_x)
140
142
        self.assertContainsRe(help_x, "Purpose:")
141
143
        self.assertContainsRe(help_x, "Usage:")
146
148
        self.assertContainsRe(help_x, "Aliases:")
147
149
 
148
150
    def test_help_usage(self):
149
 
        usage = self.run_bzr('diff --usage')[0]
 
151
        usage  = self.run_bzr('diff --usage')[0]
150
152
        self.assertContainsRe(usage, "Purpose:")
151
153
        self.assertContainsRe(usage, "Usage:")
152
154
        self.assertContainsRe(usage, "Options:")
162
164
        for line in help.split('\n'):
163
165
            if '--long' in line:
164
166
                self.assertContainsRe(line,
165
 
                                      r'Show help on all commands\.')
 
167
                    r'Show help on all commands\.')
166
168
 
167
169
    def test_help_with_aliases(self):
168
170
        original = self.run_bzr('help cat')[0]
187
189
        self.overrideAttr(i18n, '_translations', ZzzTranslations())
188
190
 
189
191
    def test_help_command_utf8(self):
190
 
        out, err = self.run_bzr_raw(["help", "push"], encoding="utf-8")
191
 
        self.assertContainsRe(out, b"zz\xc3\xa5{{:See also:")
 
192
        out, err = self.run_bzr(["help", "push"], encoding="utf-8")
 
193
        self.assertContainsRe(out, "zz\xc3\xa5{{:See also:")
192
194
 
193
195
    def test_help_switch_utf8(self):
194
 
        out, err = self.run_bzr_raw(["push", "--help"], encoding="utf-8")
195
 
        self.assertContainsRe(out, b"zz\xc3\xa5{{:See also:")
 
196
        out, err = self.run_bzr(["push", "--help"], encoding="utf-8")
 
197
        self.assertContainsRe(out, "zz\xc3\xa5{{:See also:")
196
198
 
197
199
    def test_help_command_ascii(self):
198
 
        out, err = self.run_bzr_raw(["help", "push"], encoding="ascii")
199
 
        self.assertContainsRe(out, b"zz\\?{{:See also:")
 
200
        out, err = self.run_bzr(["help", "push"], encoding="ascii")
 
201
        self.assertContainsRe(out, "zz\\?{{:See also:")
200
202
 
201
203
    def test_help_switch_ascii(self):
202
 
        out, err = self.run_bzr_raw(["push", "--help"], encoding="ascii")
203
 
        self.assertContainsRe(out, b"zz\\?{{:See also:")
 
204
        out, err = self.run_bzr(["push", "--help"], encoding="ascii")
 
205
        self.assertContainsRe(out, "zz\\?{{:See also:")