Exemplo n.º 1
0
def test_nullable():
    props.Regex("[az]+", nullable=True).load(None)
Exemplo n.º 2
0
def test_validates():
    props.Regex("[az]+").load("abc")
Exemplo n.º 3
0
def test_default():
    assert props.Regex("[az]+", default="abcde").load(None) == "abcde"
Exemplo n.º 4
0
def test_invalid_string():
    with pytest.raises(props.PropertyValidationError):
        props.Regex("[az]+").load("ABC")
Exemplo n.º 5
0
def test_wrong_type():
    with pytest.raises(props.PropertyValidationError):
        props.Regex("[az]+").load(12345)
Exemplo n.º 6
0
def test_not_nullable():
    with pytest.raises(props.PropertyValidationError):
        props.Regex("[az]+").load(None)