Exemplo n.º 1
0
    def test_reversi_gameloop(self):
        def test_game():
            print('test_game')
            return True

        app = Reversi()
        app.game = test_game
        with captured_stdout() as stdout:
            app.gameloop()

        lines = stdout.getvalue().splitlines()
        self.assertEqual(lines[0], 'test_game')