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