示例#1
0
def test_true_from_string():
    assert props.Bool().load("true") is True
示例#2
0
def test_default():
    assert props.Bool(default=True).load(None) is True
示例#3
0
def test_validates():
    assert props.Bool().load(True)
示例#4
0
def test_wrong_type():
    with pytest.raises(props.PropertyValidationError):
        props.Bool().load("12345")
示例#5
0
def test_not_nullable():
    with pytest.raises(props.PropertyValidationError):
        props.Bool().load(None)
示例#6
0
def test_nullable():
    props.Bool(nullable=True).load(None)
示例#7
0
def test_allow_strings_is_false():
    with pytest.raises(props.PropertyValidationError):
        assert props.Bool(allow_strings=False).load("false") is False
示例#8
0
def test_false_from_string():
    assert props.Bool().load("false") is False