def test_move_wrong_guess_normal(): cg, wg, game_over, turns, msg = hangman.move(sw="cat", cg=["c"], wg=["x"], ng=["l"], turns=6) assert cg == ["c"] assert wg == ["x", "l"] assert game_over == False assert turns == 5
def test_move_repeat_correct_normal(): cg, wg, game_over, turns, msg = hangman.move(sw="cat", cg=["c"], wg=["x"], ng=["c"], turns=6) assert cg == ["c"] assert wg == ["x"] assert game_over == False assert turns == 6
def test_move_correct_guess_win(): cg, wg, game_over, turns, msg = hangman.move(sw="cat", cg=["c", "t"], wg=["x"], ng=["a"], turns=6) assert cg == ["c", "t", "a"] assert wg == ["x"] assert game_over == True assert turns == 6 assert msg == "You win , The word is cat"
def test_move_wrong_guess_lose(): cg, wg, game_over, turns, msg = hangman.move( sw="cat", cg=["c"], wg=["x", "m", "n", "o", "r", "y"], ng=["l"], turns=1) assert cg == ["c"] assert wg == ["x", "m", "n", "o", "r", "y", "l"] assert game_over == True assert turns == 0