def test_reversi_thread_start(self): class TestThreadStart: def start(self): print('thread.start()') app = Reversi() with captured_stdout() as stdout: app._thread_start(TestThreadStart()) lines = stdout.getvalue().splitlines() self.assertEqual(lines[0], 'thread.start()')
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')