From a78ea7a12b23783f0df3f7bb3e95a19cee605b54 Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Wed, 21 Feb 2024 18:34:58 -0800 Subject: [PATCH] ulwgl_test: update test for PROTONPATH not set - Remove the unnecessary statements and just simply assert the error in this case --- ulwgl_test.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/ulwgl_test.py b/ulwgl_test.py index 6b07483..ff200ea 100644 --- a/ulwgl_test.py +++ b/ulwgl_test.py @@ -1443,12 +1443,10 @@ class TestGameLauncher(unittest.TestCase): ) def test_env_proton_nodir(self): - """Test check_env when $PROTONPATH is not set on failing to setting it. + """Test check_env when $PROTONPATH in the case we failed to set it. An FileNotFoundError should be raised when we fail to set PROTONPATH """ - result = None - # Mock getting the Proton with self.assertRaises(FileNotFoundError): with patch.object( @@ -1458,11 +1456,7 @@ class TestGameLauncher(unittest.TestCase): ): os.environ["WINEPREFIX"] = self.test_file os.environ["GAMEID"] = self.test_file - result = ulwgl_run.check_env(self.env) - # Mock setting it on success - os.environ["PROTONPATH"] = self.test_file - self.assertTrue(result is self.env, "Expected the same reference") - self.assertFalse(os.environ["PROTONPATH"]) + ulwgl_run.check_env(self.env) def test_env_wine_dir(self): """Test check_env when $WINEPREFIX is not a directory.