Exemple #1
0
def test_convert_to_boolean_converts_strings_to_true_if_they_look_like_truthy():
    for truthy in ['true', 'on', 'yes', '1']:
        assert convert_to_boolean(truthy)
Exemple #2
0
def test_convert_to_boolean_leaves_other_things_unchanged():
    for value in ['falsey', 'other', True, 0]:
        assert convert_to_boolean(value) == value
Exemple #3
0
def test_convert_to_boolean_converts_strings_to_false_if_they_look_falsy():
    for falsy in ['false', 'off', 'no', '0']:
        assert not convert_to_boolean(falsy)
def test_convert_to_boolean_converts_strings_to_false_if_they_look_falsy():
    for falsy in ['false', 'off', 'no', '0']:
        assert not convert_to_boolean(falsy)
def test_convert_to_boolean_converts_strings_to_true_if_they_look_like_truthy():
    for truthy in ['true', 'on', 'yes', '1']:
        assert convert_to_boolean(truthy)
def test_convert_to_boolean_leaves_other_things_unchanged():
    for value in ['falsey', 'other', True, 0]:
        assert convert_to_boolean(value) == value