def test_game_over_from_incorrect_guesses(): game = m.Game(word="beluga") game.incorrect_guesses = ["c", "d", "f", "h", "i", "j", "k", "m"] assert game.is_game_over() game.incorrect_guesses.append("z") assert game.is_game_over()
def test_add_guess_adds_correct_guess_case_insensitive(): game = m.Game(word="beluga") game.add_guess("B") assert len(game.correct_guesses) == 1 assert len(game.incorrect_guesses) == 0
def test_add_guess_adds_correct_guess(): game = m.Game(word="beluga") game.add_guess("b") assert len(game.correct_guesses) == 1 assert len(game.incorrect_guesses) == 0
def test_have_all_letters_been_guessed_true(): game = m.Game(word="beluga") game.correct_guesses = ["b", "e", "l", "u", "g", "a"] assert game.have_all_letters_been_guessed()
def test_game_over_from_correct_guesses(): game = m.Game(word="beluga") game.correct_guesses = ["b", "e", "l", "u", "g", "a"] assert game.is_game_over()
def test_game_is_not_over_if_no_guesses(): game = m.Game(word="beluga") assert not game.is_game_over()
def test_game_can_be_made(): game = m.Game(word="beluga") assert game.word == "beluga" assert len(game.correct_guesses) == 0 assert len(game.incorrect_guesses) == 0