Expand unit test for Gramps parsing error.
This commit is contained in:
parent
1b53a3948a
commit
8a5c8ffbc9
@ -41,9 +41,21 @@ class TestArgParser(unittest.TestCase):
|
|||||||
assert bad, ap.__dict__
|
assert bad, ap.__dict__
|
||||||
|
|
||||||
def test_y_shortopt_sets_auto_accept(self):
|
def test_y_shortopt_sets_auto_accept(self):
|
||||||
bad,ap = self.triggers_option_error('-y')
|
bad, ap = self.triggers_option_error('-y')
|
||||||
assert not bad, ap.errors
|
|
||||||
assert ap.auto_accept
|
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):
|
def test_yes_longopt_sets_auto_accept(self):
|
||||||
bad,ap = self.triggers_option_error('--yes')
|
bad,ap = self.triggers_option_error('--yes')
|
||||||
|
Loading…
Reference in New Issue
Block a user