Exemplo n.º 1
0
def test_check_boolean_value_raises_exception_for_invalid_string():
    with pytest.raises(Exception):
        check_boolean_value("not a boolean")
Exemplo n.º 2
0
def test_check_boolean_value_accepts_valid_false_strings():
    for option_string in ["false", "f", "no", "n"]:
        assert not check_boolean_value(option_string)
        assert not check_boolean_value(option_string.upper())
Exemplo n.º 3
0
def test_check_boolean_value_accepts_valid_true_strings():
    for option_string in ["true", "t", "yes", "y"]:
        assert check_boolean_value(option_string)
        assert check_boolean_value(option_string.upper())
Exemplo n.º 4
0
def test_check_boolean_value_raises_exception_for_invalid_string():
    with pytest.raises(Exception):
        check_boolean_value("not a boolean")
Exemplo n.º 5
0
def test_check_boolean_value_accepts_valid_false_strings():
    for option_string in ["false", "f", "no", "n"]:
        assert not check_boolean_value(option_string)
        assert not check_boolean_value(option_string.upper())
Exemplo n.º 6
0
def test_check_boolean_value_accepts_valid_true_strings():
    for option_string in ["true", "t", "yes", "y"]:
        assert check_boolean_value(option_string)
        assert check_boolean_value(option_string.upper())