Exemplo n.º 1
0
def test_validate_number_invalid_small(ocx):
    schema_props = schema_rules(ocx, "location_lat")
    with pytest.raises(ValidationError) as exception_info:
        validate_number("-200", schema_props)
    assert "-200 must be larger than the minimum value: -90.0" in str(
        exception_info)
Exemplo n.º 2
0
def test_validate_number_valid(ocx):
    schema_props = schema_rules(ocx, "location_lat")
    valid_number = validate_number("50", schema_props)
    assert valid_number == 50
Exemplo n.º 3
0
def test_validate_number_invalid_small(ocx):
    schema_props = schema_rules(ocx, "location_lat")
    with pytest.raises(ValidationError) as exception_info:
        validate_number("-200", schema_props)
    assert "-200 must be larger than the minimum value: -90.0" in str(exception_info)
Exemplo n.º 4
0
def test_validate_number_valid(ocx):
    schema_props = schema_rules(ocx, "location_lat")
    valid_number = validate_number("50", schema_props)
    assert valid_number == 50
Exemplo n.º 5
0
def test_validate_number_invalid_small():
    schema_props = schema_rules('location_lat')
    with pytest.raises(ValidationError) as exception_info:
        validate_number('-200', schema_props)
    assert '-200 must be larger than the minimum value: -90.0' in str(
        exception_info)
Exemplo n.º 6
0
def test_validate_number_valid():
    schema_props = schema_rules('location_lat')
    valid_number = validate_number('50', schema_props)
    assert valid_number == 50