Ejemplo n.º 1
0
def test_yesno_question_validate_answer() -> None:
    q = YesNoQuestion(1, 'choose!')
    a1 = Answer(False)
    a2 = Answer(1)
    assert q.validate_answer(a1) is True
    assert q.validate_answer(a2) is False
Ejemplo n.º 2
0
def test_survey_yesno_invalid_answer() -> None:
    """A test for validate_answer() in class YesNoQuestion."""
    q = YesNoQuestion(1, 'ABC')
    a = Answer(2)
    assert q.validate_answer(a) is False