Exemplo n.º 1
0
def test_CorrectInput3():
    maze_game.csvlist = [['X', 'X', 'X', 'X', 'X', 'X', 'X', 'X'],
                         ['X', 'O', 'O', 'O', 'X', 'O', 'O', 'X'],
                         ['X', 'O', 'X', 'O', 'X', 'O', 'X', 'X'],
                         ['X', 'O', 'X', 'O', 'X', 'O', 'O', 'X'],
                         ['X', 'O', 'X', 'O', 'X', 'X', 'O', 'X'],
                         ['X', 'O', 'X', 'O', 'X', 'O', 'O', 'X'],
                         ['X', 'A', 'X', 'O', 'O', 'O', 'X', 'X'],
                         ['X', 'B', 'X', 'X', 'X', 'X', 'X', 'X']]
    set_keyboard_input(["3", "S", "n"])
    #with pytest.raises(SystemExit) as exc:
    with pytest.raises(SystemExit) as exc:
        maze_game.menu()
        output = get_display_output()
        assert exc.value.code == 1
Exemplo n.º 2
0
def test_wronginput1():
    set_keyboard_input([""])
    with pytest.raises(IndexError) as exc:
        maze_game.menu()
        output = get_display_output()
        assert exc.value.code == 1
Exemplo n.º 3
0
def test_CorrectInput0():
    set_keyboard_input(["0"])
    with pytest.raises(SystemExit) as exc:
        maze_game.menu()
        output = get_display_output()
        assert exc.value.code == 1
Exemplo n.º 4
0
def test_CorrectInput4():
    set_keyboard_input(["4"])

    results = maze_game.menu()

    assert results == "To be implemented4"