Esempio n. 1
0
 def test1_run_game_subprocess(self, launcher_mock, mock_popen, mock_os_chdir, mock_os_getcwd):
     mock_process = "Mock Process"
     mock_popen.return_value = mock_process
     game = Game("Test Game", install_dir="/test/install/dir")
     exp = ("", mock_process)
     obs = launcher.run_game_subprocess(game)
     self.assertEqual(exp, obs)
Esempio n. 2
0
 def test2_run_game_subprocess(self, launcher_mock, mock_popen,
                               mock_os_chdir, mock_os_getcwd):
     mock_popen.side_effect = FileNotFoundError()
     game = Game("Test Game", install_dir="/test/install/dir")
     exp = ('No executable was found in /test/install/dir', None)
     obs = launcher.run_game_subprocess(game)
     self.assertEqual(exp, obs)