Exemplo n.º 1
0
def test_type_enforce_exceptions(type_spec, value):
    entry = EntryInfo(enforce=type_spec)
    with pytest.raises(ValueError):
        entry.enforce_value(value)
Exemplo n.º 2
0
def test_type_enforce_ok(type_spec, value, expected):
    entry = EntryInfo(enforce=type_spec)
    assert entry.enforce_value(value) == expected