Esempio n. 1
0
def test_check_boolean_value_raises_exception_for_invalid_string():
    with pytest.raises(Exception):
        check_boolean_value("not a boolean")
Esempio 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())
Esempio 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())
Esempio n. 4
0
def test_check_boolean_value_raises_exception_for_invalid_string():
    with pytest.raises(Exception):
        check_boolean_value("not a boolean")
Esempio 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())
Esempio 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())