Пример #1
0
 def test_parse_args(self):
     """Option parser"""
     # XXX: Using cmd_commit makes these tests overly sensitive to changes
     # to cmd_commit, when they are meant to be about option parsing in
     # general.
     self.assertEqual(parse_args(cmd_commit(), ['--help']),
        ([], {'exclude': [], 'fixes': [], 'help': True}))
     self.assertEqual(parse_args(cmd_commit(), ['--message=biter']),
        ([], {'exclude': [], 'fixes': [], 'message': 'biter'}))
Пример #2
0
 def test_parse_args(self):
     """Option parser"""
     # XXX: Using cmd_commit makes these tests overly sensitive to changes
     # to cmd_commit, when they are meant to be about option parsing in
     # general.
     self.assertEqual(
        ([], {'author': [], 'exclude': [], 'fixes': [], 'help': True}),
        parse_args(cmd_commit(), ['--help']))
     self.assertEqual(
        ([], {'author': [], 'exclude': [], 'fixes': [], 'message': 'biter'}),
        parse_args(cmd_commit(), ['--message=biter']))
Пример #3
0
 def test_no_more_opts(self):
     """Terminated options"""
     self.assertEqual(parse_args(cmd_commit(), ['--', '-file-with-dashes']),
                      (['-file-with-dashes'], {
                          'exclude': [],
                          'fixes': []
                      }))
Пример #4
0
 def test_allow_dash(self):
     """Test that we can pass a plain '-' as an argument."""
     self.assertEqual((['-']), parse_args(cmd_commit(), ['-'])[0])
Пример #5
0
 def test_allow_dash(self):
     """Test that we can pass a plain '-' as an argument."""
     self.assertEqual((['-']), parse_args(cmd_commit(), ['-'])[0])
Пример #6
0
 def test_no_more_opts(self):
     """Terminated options"""
     self.assertEqual(parse_args(cmd_commit(), ['--', '-file-with-dashes']),
                       (['-file-with-dashes'], {'exclude': [], 'fixes': []}))