~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/tests/test_options.py

  • Committer: Vincent Ladeuil
  • Date: 2011-09-26 15:40:02 UTC
  • mto: This revision was merged to the branch mainline in revision 6178.
  • Revision ID: v.ladeuil+lp@free.fr-20110926154002-exguk3psfpc4b2uw
Allow config options to be overridden from the command line

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
45
45
        # general.
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'}))
 
46
        self.assertEqual(
 
47
           ([], {'author': [], 'exclude': [], 'fixes': [], 'help': True,
 
48
                 'override_config': []}),
 
49
           parse_args(cmd_commit(), ['--help']))
 
50
        self.assertEqual(
 
51
           ([], {'author': [], 'exclude': [], 'fixes': [], 'message': 'biter',
 
52
                 'override_config': []}),
 
53
           parse_args(cmd_commit(), ['--message=biter']))
50
54
 
51
55
    def test_no_more_opts(self):
52
56
        """Terminated options"""
53
 
        self.assertEqual(parse_args(cmd_commit(), ['--', '-file-with-dashes']),
54
 
                          (['-file-with-dashes'], {'author': [], 'exclude': [], 'fixes': []}))
 
57
        self.assertEqual(
 
58
            (['-file-with-dashes'], {'author': [], 'exclude': [], 'fixes': [],
 
59
                                     'override_config': []}),
 
60
            parse_args(cmd_commit(), ['--', '-file-with-dashes']))
55
61
 
56
62
    def test_option_help(self):
57
63
        """Options have help strings."""