43
43
# XXX: Using cmd_commit makes these tests overly sensitive to changes
44
44
# to cmd_commit, when they are meant to be about option parsing in
47
([], {'author': [], 'exclude': [], 'fixes': [], 'help': True}),
48
parse_args(cmd_commit(), ['--help']))
50
([], {'author': [], 'exclude': [], 'fixes': [], 'message': 'biter'}),
51
parse_args(cmd_commit(), ['--message=biter']))
46
self.assertEqual(parse_args(cmd_commit(), ['--help']),
47
([], {'author': [], 'exclude': [], 'fixes': [], 'help': True}))
48
self.assertEqual(parse_args(cmd_commit(), ['--message=biter']),
49
([], {'author': [], 'exclude': [], 'fixes': [], 'message': 'biter'}))
53
51
def test_no_more_opts(self):
54
52
"""Terminated options"""
56
(['-file-with-dashes'], {'author': [], 'exclude': [], 'fixes': []}),
57
parse_args(cmd_commit(), ['--', '-file-with-dashes']))
53
self.assertEqual(parse_args(cmd_commit(), ['--', '-file-with-dashes']),
54
(['-file-with-dashes'], {'author': [], 'exclude': [], 'fixes': []}))
59
56
def test_option_help(self):
60
57
"""Options have help strings."""
68
65
out, err = self.run_bzr('help status')
69
66
self.assertContainsRe(out, r'--show-ids.*Show internal object.')
71
def test_option_help_global_hidden(self):
72
"""Hidden global options have no help strings."""
73
out, err = self.run_bzr('help log')
74
self.assertNotContainsRe(out, r'--message')
76
68
def test_option_arg_help(self):
77
69
"""Help message shows option arguments."""
78
70
out, err = self.run_bzr('help commit')