from qz.quality import is_valid_question


def test_is_valid_question():
    # Valid case
    assert is_valid_question(
        "What is the capital of France?", ["Paris", "London", "Berlin"], "Paris"
    )

    # Invalid cases
    assert not is_valid_question("", ["A", "B"], "A")  # Empty question
    assert not is_valid_question("Test?", ["A", "B"], "C")  # Answer not in options
    assert not is_valid_question("Test?", ["A", "A"], "A")  # Duplicate options
    assert not is_valid_question("Test?", ["A"], "A")  # Too few options
