示例#1
0
def test_true():
    """
    Ensure all expected strings return True
    """
    for value in ("yes", "y", "true", "t", "1"):
        yield assert_equal, True, convert_bool(value)
示例#2
0
def test_empty_string():
    """
    Specifically test that an empty string returns False
    """
    assert_equal(False, convert_bool(""))
示例#3
0
def test_false():
    """
    Ensure all expected strings return False
    """
    for value in ("no", "n", "false", "f", "0"):
        yield assert_equal, False, convert_bool(value)