commit bf8a33f8470d328d7728483bd3107ba0cf4466b0 Author: Damian Johnson atagar@torproject.org Date: Sun Sep 8 14:21:44 2013 -0700
Testing that we reject unrecognized arguments
Oops, test case I forgot to add. --- test/starter.py | 4 ++++ 1 file changed, 4 insertions(+)
diff --git a/test/starter.py b/test/starter.py index d4720b1..a4e6fdf 100644 --- a/test/starter.py +++ b/test/starter.py @@ -2,6 +2,7 @@ Unit tests for arm's initialization module. """
+import getopt import unittest
from arm.starter import _get_args, ARGS @@ -48,6 +49,9 @@ class TestArgumentParsing(unittest.TestCase): self.assertEqual('we', args.logged_events) self.assertEqual('/tmp/cfg', args.config)
+ def test_that_we_reject_unrecognized_arguments(self): + self.assertRaises(getopt.GetoptError, _get_args, ['--blarg', 'stuff']) + def test_that_we_reject_invalid_interfaces(self): invalid_inputs = ( '',
tor-commits@lists.torproject.org