class test_OnOffVar(unittest.TestCase): """ verify functionality of the OnOffVar variable class """ def setUp(self): self.ovar = OnOffVar('name', 'description') def testValidation(self): """ check to see that various inputs result in a Boolean Value """ for val in ('f','F','n','N','false',0,'off'): self.assertEqual(self.ovar.validate(val), 'off') for val in ('t','T','y','Y','true',1,'on'): self.assertEqual(self.ovar.validate(val), 'on') self.assertRaises(ValidationException, self.ovar.validate, 'lunchbox')
class test_OnOffVar(unittest.TestCase): """ verify functionality of the OnOffVar variable class """ def setUp(self): self.ovar = OnOffVar('name', 'description') def testValidation(self): """ check to see that various inputs result in a Boolean Value """ for val in ('f', 'F', 'n', 'N', 'false', 0, 'off'): self.assertEqual(self.ovar.validate(val), 'off') for val in ('t', 'T', 'y', 'Y', 'true', 1, 'on'): self.assertEqual(self.ovar.validate(val), 'on') self.assertRaises(ValidationException, self.ovar.validate, 'lunchbox')
This options lets you select the port # that Zope will use for serving HTTP. """, min=1024, max=65535, ) VAR_DEBUG_MODE = OnOffVar('debug_mode', title='Debug Mode', description='Should debug mode be "on" or "off"?', default='off', modes=(EXPERT, EASY), page='Main', help=""" Debug mode (sometimes called "Debug/Development Mode") is the correct setting for running a site under development--it ensures that on-disk changes to templates and skin scripts are immediately visible, and allows use of certain add-on debugging/profiling products. Running your Zope in the foreground (with "bin/plonectl fg" or similar commands) always puts you in debug mode; this setting controls whether you are in debug mode even when running in the background. You should set this to "on" during development; once you are ready to deploy your site, you change this to "off" in your buildout.cfg. """) VAR_VERBOSE_SEC = OnOffVar( 'verbose_security', title='Verbose Security?', description='Should verbose security be "on" or "off"?', default='off', modes=(EASY, EXPERT),
def setUp(self): self.ovar = OnOffVar('name', 'description')