()
| 70 | |
| 71 | |
| 72 | def test_getPlayerMove(): |
| 73 | board = checkers.getNewBoard() |
| 74 | sys.stdin = io.StringIO('B3\nA4\n') |
| 75 | assert checkers.getPlayerMove(board, 'X') == ('B3', 'A4') |
| 76 | |
| 77 | # Test quitting: |
| 78 | board = checkers.getNewBoard() |
| 79 | with pytest.raises(SystemExit): |
| 80 | sys.stdin = io.StringIO('QUIT\n') |
| 81 | checkers.getPlayerMove(board, 'X') |
| 82 | |
| 83 | with pytest.raises(SystemExit): |
| 84 | sys.stdin = io.StringIO('quit\n') |
| 85 | checkers.getPlayerMove(board, 'X') |
| 86 | |
| 87 | with pytest.raises(SystemExit): |
| 88 | sys.stdin = io.StringIO('qUiT\n') |
| 89 | checkers.getPlayerMove(board, 'X') |
| 90 | |
| 91 | with pytest.raises(SystemExit): |
| 92 | sys.stdin = io.StringIO(' quit \n') |
| 93 | checkers.getPlayerMove(board, 'X') |
| 94 | |
| 95 | |
| 96 | def test_makeMove(): |
nothing calls this directly
no outgoing calls
no test coverage detected