Exemple #1
0
def test_validate_float_option_exception_message_contains_correct_info():
    msg = "dummy"
    str_val = "abcde"
    with pytest.raises(SchemaError) as exc_info:
        validate_float_option(str_val, msg)

    check_exception_message(exc_info, msg, str_val)
Exemple #2
0
def test_validate_float_option_exception_message_contains_correct_info():
    msg = "dummy"
    str_val = "abcde"
    with pytest.raises(SchemaError) as exc_info:
        validate_float_option(str_val, msg)

    check_exception_message(exc_info, msg, str_val)
Exemple #3
0
def test_validate_float_option_raises_exception_for_non_float():
    with pytest.raises(SchemaError):
        validate_float_option("a", "dummy")
Exemple #4
0
def test_validate_float_option_returns_correct_value():
    float_val = 0.3532
    assert validate_float_option(str(float_val), "dummy") == float_val
Exemple #5
0
def test_validate_float_option_raises_exception_for_non_float():
    with pytest.raises(SchemaError):
        validate_float_option("a", "dummy")
Exemple #6
0
def test_validate_float_option_returns_correct_value():
    float_val = 0.3532
    assert validate_float_option(str(float_val), "dummy") == float_val