def test_show_board1(self, mock_stdout): game = TicTacGame() expected_output = " | | \n-+-+-\n | | \n-+-+-\n | | \n" game.show_board() self.assertEqual(mock_stdout.getvalue(), expected_output)
def test_show_board3(self, mock_stdout): game = TicTacGame() expected_output = "O|O|O\n-+-+-\nO|O|O\n-+-+-\nO|O|O\n" game.board = [['O'] * 3 for j in range(3)] game.show_board() self.assertEqual(mock_stdout.getvalue(), expected_output)