Exemplo n.º 1
0
    def test_reversi_start(self):
        def test_game_start():
            print('test_game_start')

        def test_window_start():
            print('test_window_start')

        app = Reversi()
        app.game_start = test_game_start
        app.window_start = test_window_start
        with captured_stdout() as stdout:
            app.start()

        lines = stdout.getvalue().splitlines()
        self.assertEqual(lines[0], 'test_game_start')
        self.assertEqual(lines[1], 'test_window_start')