ulwgl_test: update test for PROTONPATH not set

- Remove the unnecessary statements and just simply assert the error in this case
This commit is contained in:
R1kaB3rN 2024-02-21 18:34:58 -08:00
parent 0bbd251248
commit a78ea7a12b
No known key found for this signature in database

View File

@ -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.