Пример #1
0
def test_next_question_causes_finish():
    Quiz.max_time_in_seconds = 0.1
    quiz = Quiz(FakeSource, 1234, "easy", "9", None)
    quiz.start()

    for _ in range(10):
        sleep(0.1)
        quiz.next_question()

    assert quiz.is_finished
Пример #2
0
def test_next_question():
    Quiz.max_time_in_seconds = 0.1
    quiz = Quiz(FakeSource, 1234, "easy", "9", None)
    quiz.start()
    start_question = quiz.current_question

    sleep(0.1)
    quiz.next_question()
    second_question = quiz.current_question

    assert start_question is second_question - 1