示例#1
0
文件: tests.py 项目: lbragstad/jsd
class TestBooleanTypeRequired(TestTypes, unittest.TestCase):
    schema = jsd.Boolean(required=True).json()
    expected_schema = {'type': 'boolean'}

    valid_input = [True, False]
    invalid_input = ['s', 1, None]
示例#2
0
文件: tests.py 项目: lbragstad/jsd
 class Example(jsd.Object):
     thing = jsd.OneOf(jsd.String(),
                       jsd.Boolean(required=True))
示例#3
0
文件: tests.py 项目: lbragstad/jsd
class TestBooleanType(TestTypes, unittest.TestCase):
    schema = jsd.Boolean().json()
    expected_schema = {'type': ['boolean', 'null']}

    valid_input = [True, False, None]
    invalid_input = ['s', 1]