예제 #1
0
파일: test_app.py 프로젝트: y-tetsu/reversi
    def test_reversi_game_start(self):
        def test_thread_start(game_thread):
            print(game_thread.daemon)

        app = Reversi()
        app._thread_start = test_thread_start
        with captured_stdout() as stdout:
            app.game_start()

        lines = stdout.getvalue().splitlines()
        self.assertEqual(lines[0], 'True')
예제 #2
0
파일: test_app.py 프로젝트: y-tetsu/reversi
    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')