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'}))
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']))
def test_no_more_opts(self): """Terminated options""" self.assertEqual(parse_args(cmd_commit(), ['--', '-file-with-dashes']), (['-file-with-dashes'], { 'exclude': [], 'fixes': [] }))
def test_allow_dash(self): """Test that we can pass a plain '-' as an argument.""" self.assertEqual((['-']), parse_args(cmd_commit(), ['-'])[0])
def test_no_more_opts(self): """Terminated options""" self.assertEqual(parse_args(cmd_commit(), ['--', '-file-with-dashes']), (['-file-with-dashes'], {'exclude': [], 'fixes': []}))