def testBoolean(self): b = formless.Boolean(required=True) self.assertRaises(formless.InputError, process, b, "zoom") self.assertRaises(formless.InputError, process, b, True) self.assertRaises(formless.InputError, process, b, 54) self.assertRaises(formless.InputError, process, b, "") self.assertEqual(process(b, "True"), True) self.assertEqual(process(b, "False"), False) b = formless.Boolean(required=False) self.assertRaises(formless.InputError, process, b, "zoom") self.assertEqual(process(b, ""), None) self.assertEqual(process(b, "True"), True) self.assertEqual(process(b, "False"), False)
def baz(bazfoo=formless.Boolean(label="The Foo", description="The foo to baz.")): """The Label The description""" IFoo = _indirectIFoo() return IFoo