[Zodb-checkins] CVS: ZODB3/zdaemon/tests - testzdoptions.py:1.11
Fred L. Drake, Jr.
fred@zope.com
Thu, 20 Feb 2003 10:37:44 -0500
Update of /cvs-repository/ZODB3/zdaemon/tests
In directory cvs.zope.org:/tmp/cvs-serv12886
Modified Files:
testzdoptions.py
Log Message:
Add some basic tests for the -X command line option.
=== ZODB3/zdaemon/tests/testzdoptions.py 1.10 => 1.11 ===
--- ZODB3/zdaemon/tests/testzdoptions.py:1.10 Thu Feb 20 10:02:07 2003
+++ ZODB3/zdaemon/tests/testzdoptions.py Thu Feb 20 10:37:41 2003
@@ -260,9 +260,25 @@
self.assertEqual(options.opt, 2)
+class TestCommandLineOverrides(EnvironmentOptions):
+
+ def test_simple_override(self):
+ options = self.create_with_config("# empty config")
+ options.realize(["-X", "opt=-2"])
+ self.assertEqual(options.opt, -2)
+
+ def test_error_propogation(self):
+ self.check_exit_code(self.create_with_config("# empty"),
+ ["-Xopt=1", "-Xopt=2"])
+ self.check_exit_code(self.create_with_config("# empty"),
+ ["-Xunknown=foo"])
+
+
def test_suite():
suite = unittest.TestSuite()
- for cls in [TestBasicFunctionality, TestZDOptionsEnvironment]:
+ for cls in [TestBasicFunctionality,
+ TestZDOptionsEnvironment,
+ TestCommandLineOverrides]:
suite.addTest(unittest.makeSuite(cls))
return suite