Expand unit test for Gramps parsing error.

This commit is contained in:
Baizley 2019-12-20 21:47:30 +01:00 committed by Nick Hall
parent 1b53a3948a
commit 8a5c8ffbc9

View File

@ -41,9 +41,21 @@ class TestArgParser(unittest.TestCase):
assert bad, ap.__dict__
def test_y_shortopt_sets_auto_accept(self):
bad,ap = self.triggers_option_error('-y')
assert not bad, ap.errors
assert ap.auto_accept
bad, ap = self.triggers_option_error('-y')
self.assertFalse(bad)
expected_errors = [(
'Error parsing the arguments',
'Error parsing the arguments: [ -y ] \n' +
'To use in the command-line mode, supply at least one input file to process.'
)]
self.assertEqual(
expected_errors,
ap.errors
)
self.assertTrue(ap.auto_accept)
def test_yes_longopt_sets_auto_accept(self):
bad,ap = self.triggers_option_error('--yes')