Пример #1
0
def test_check_boolean_value_raises_exception_for_invalid_string():
    with pytest.raises(Exception):
        check_boolean_value("not a boolean")
Пример #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())
Пример #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())
Пример #4
0
def test_check_boolean_value_raises_exception_for_invalid_string():
    with pytest.raises(Exception):
        check_boolean_value("not a boolean")
Пример #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())
Пример #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())