/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/bash_completion/tests/test_bashcomp.py

  • Committer: Jelmer Vernooij
  • Date: 2019-06-02 02:35:46 UTC
  • mfrom: (7309 work)
  • mto: This revision was merged to the branch mainline in revision 7319.
  • Revision ID: jelmer@jelmer.uk-20190602023546-lqco868tnv26d8ow
merge trunk.

Show diffs side-by-side

added added

removed removed

Lines of Context:
48
48
        encoding = osutils.get_user_encoding()
49
49
        input = b'%s\n' % self.script.encode(encoding)
50
50
        input += (b'COMP_WORDS=( %s )\n' %
51
 
                  b' '.join([b"'"+w.replace("'", "'\\''").encode(encoding)+b"'" for w in words]))
 
51
                  b' '.join([b"'" + w.replace("'", "'\\''").encode(encoding) + b"'" for w in words]))
52
52
        input += b'COMP_CWORD=%d\n' % cword
53
 
        input += b'%s\n' % getattr(self, 'script_name', '_brz').encode(encoding)
 
53
        input += b'%s\n' % getattr(self, 'script_name',
 
54
                                   '_brz').encode(encoding)
54
55
        input += b'echo ${#COMPREPLY[*]}\n'
55
56
        input += b"IFS=$'\\n'\n"
56
57
        input += b'echo "${COMPREPLY[*]}"\n'
291
292
        dc = DataCollector()
292
293
        dc.global_options()
293
294
        self.assertSubset(['--no-plugins', '--builtin'],
294
 
                           dc.data.global_options)
 
295
                          dc.data.global_options)
295
296
 
296
297
    def test_commands(self):
297
298
        dc = DataCollector()
298
299
        dc.commands()
299
300
        self.assertSubset(['init', 'init-repo', 'init-repository'],
300
 
                           dc.data.all_command_aliases())
 
301
                          dc.data.all_command_aliases())
301
302
 
302
303
    def test_commands_from_plugins(self):
303
304
        dc = DataCollector()
304
305
        dc.commands()
305
306
        self.assertSubset(['bash-completion'],
306
 
                           dc.data.all_command_aliases())
 
307
                          dc.data.all_command_aliases())
307
308
 
308
309
    def test_commit_dashm(self):
309
310
        dc = DataCollector()
310
311
        cmd = dc.command('commit')
311
312
        self.assertSubset(['-m'],
312
 
                           [str(o) for o in cmd.options])
 
313
                          [str(o) for o in cmd.options])
313
314
 
314
315
    def test_status_negated(self):
315
316
        dc = DataCollector()
316
317
        cmd = dc.command('status')
317
318
        self.assertSubset(['--no-versioned', '--no-verbose'],
318
 
                           [str(o) for o in cmd.options])
 
319
                          [str(o) for o in cmd.options])
319
320
 
320
321
    def test_init_format(self):
321
322
        dc = DataCollector()