[Zodb-checkins] CVS: Zope/lib/python/zdaemon/tests - testzdoptions.py:1.11.16.1

Chris McDonough chrism at zopemafia.com
Sun Dec 21 18:28:22 EST 2003


Update of /cvs-repository/Zope/lib/python/zdaemon/tests
In directory cvs.zope.org:/tmp/cvs-serv14499/tests

Modified Files:
      Tag: Zope-2_7-branch
	testzdoptions.py 
Log Message:
Add an ignore_getopt_errs indicator to ZDOptions.realize and tests for the indicator.  If this flag is true, ignore any errors that come out of getopt.  This is used to service interactive configuration from user-supplied scripts under which the command line options and arguments are not meant for ZDOptions and can be safely ignored.


=== Zope/lib/python/zdaemon/tests/testzdoptions.py 1.11 => 1.11.16.1 ===
--- Zope/lib/python/zdaemon/tests/testzdoptions.py:1.11	Thu Feb 20 10:37:41 2003
+++ Zope/lib/python/zdaemon/tests/testzdoptions.py	Sun Dec 21 18:28:21 2003
@@ -152,6 +152,14 @@
         options.add("setting", None, "a:", handler=int)
         self.check_exit_code(options, ["-afoo"])
 
+    def test_raise_getopt_errors(self):
+        options = self.OptionsClass()
+        # note that we do not add "a" to the list of options;
+        # if raise_getopt_errors was true, this test would error
+        options.realize(["-afoo"], raise_getopt_errs=False)
+        # check_exit_code realizes the options with raise_getopt_errs=True
+        self.check_exit_code(options, ['-afoo'])
+                                       
 
 class EnvironmentOptions(ZDOptionsTestBase):
 




More information about the Zodb-checkins mailing list