[Zope-Checkins] CVS: ZODB3/zdaemon/tests - testzdoptions.py:1.3

Fred L. Drake, Jr. fred@zope.com
Mon, 20 Jan 2003 15:12:33 -0500


Update of /cvs-repository/ZODB3/zdaemon/tests
In directory cvs.zope.org:/tmp/cvs-serv9566

Modified Files:
	testzdoptions.py 
Log Message:
Add tests for the positional arg support.


=== ZODB3/zdaemon/tests/testzdoptions.py 1.2 => 1.3 ===
--- ZODB3/zdaemon/tests/testzdoptions.py:1.2	Mon Jan 20 14:40:19 2003
+++ ZODB3/zdaemon/tests/testzdoptions.py	Mon Jan 20 15:12:30 2003
@@ -84,6 +84,24 @@
         # haven't been enabled.
         self.check_exit_code(self.OptionsClass(), ["A"])
 
+    def test_positional_args(self):
+        options = self.OptionsClass()
+        options.positional_args_allowed = 1
+        options.realize(["A", "B"])
+        self.assertEqual(options.args, ["A", "B"])
+
+    def test_positional_args_empty(self):
+        options = self.OptionsClass()
+        options.positional_args_allowed = 1
+        options.realize([])
+        self.assertEqual(options.args, [])
+
+    def test_positional_args_unknown_option(self):
+        # Make sure an unknown option doesn't become a positional arg.
+        options = self.OptionsClass()
+        options.positional_args_allowed = 1
+        self.check_exit_code(options, ["-o", "A", "B"])
+
     def test_conflicting_flags(self):
         # Check that we get an error for flags which compete over the
         # same option setting.