コード例 #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)
コード例 #2
0
def test_convert_to_boolean_leaves_other_things_unchanged():
    for value in ['falsey', 'other', True, 0]:
        assert convert_to_boolean(value) == value
コード例 #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)
コード例 #4
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)
コード例 #5
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)
コード例 #6
0
def test_convert_to_boolean_leaves_other_things_unchanged():
    for value in ['falsey', 'other', True, 0]:
        assert convert_to_boolean(value) == value