def test_win(): """ Checks win scenario """ game = Game() game.words = ['game'] game.pick_random() game.input_stream = [ 'a', 'g', 'm', 'e', ] check = game.start_game() assert check assert ''.join(game.guess_word) == 'game'
def test_fail(): """ Checks lose scenario """ game = Game() game.words = ['game'] game.pick_random() game.input_stream = [ 'a', 'g', 'm', 'b', 'c', 'd', 'f', 'i', ] check = game.start_game() assert not check assert ''.join(game.guess_word) == 'gam*'