Пример #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)
Пример #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
Пример #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)
Пример #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
Пример #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)
Пример #6
0
def test_validate_number_valid():
    schema_props = schema_rules('location_lat')
    valid_number = validate_number('50', schema_props)
    assert valid_number == 50