From 63e6b1b509e02f4dd3a014f0c1210d0029c019ee Mon Sep 17 00:00:00 2001 From: R1kaB3rN <100738684+R1kaB3rN@users.noreply.github.com> Date: Tue, 23 Apr 2024 11:15:14 -0700 Subject: [PATCH] Update tests --- umu/umu_test.py | 30 ++++++++++++------------------ umu/umu_test_plugins.py | 21 +++++++++------------ 2 files changed, 21 insertions(+), 30 deletions(-) diff --git a/umu/umu_test.py b/umu/umu_test.py index dac07b340..0fba3ca98 100644 --- a/umu/umu_test.py +++ b/umu/umu_test.py @@ -248,10 +248,9 @@ def test_update_umu_empty(self): ) # Update - with patch.object( - umu_util, - "setup_runtime", - return_value=None, + with ( + patch.object(umu_util, "setup_runtime", return_value=None), + patch.object(umu_util, "_update_pv", return_value=None), ): result = umu_util._update_umu( self.test_user_share, @@ -274,7 +273,6 @@ def test_update_umu_empty(self): Path(self.test_user_share, "umu"), Path(self.test_local_share, "umu"), ) - # When the runtime updates, pressure vessel needs to be updated copytree( Path(self.test_user_share, "pressure-vessel"), Path(self.test_local_share, "pressure-vessel"), @@ -433,10 +431,9 @@ def test_update_umu(self): filer.write("foo") # Update - with patch.object( - umu_util, - "setup_runtime", - return_value=None, + with ( + patch.object(umu_util, "setup_runtime", return_value=None), + patch.object(umu_util, "_update_pv", return_value=None), ): result = umu_util._update_umu( self.test_user_share, @@ -459,7 +456,6 @@ def test_update_umu(self): Path(self.test_user_share, "umu"), Path(self.test_local_share, "umu"), ) - # When the runtime updates, pressure vessel needs to be updated copytree( Path(self.test_user_share, "pressure-vessel"), Path(self.test_local_share, "pressure-vessel"), @@ -553,10 +549,9 @@ def test_install_umu(self): # Mock setting up the runtime # In the real usage, we callout to acquire the archive and # extract to .local/share/umu - with patch.object( - umu_util, - "setup_runtime", - return_value=None, + with ( + patch.object(umu_util, "setup_runtime", return_value=None), + patch.object(umu_util, "_update_pv", return_value=None), ): result = umu_util._install_umu( self.test_user_share, self.test_local_share, json @@ -1382,10 +1377,9 @@ def test_build_command(self): os.environ[key] = val # Mock setting up the runtime - with patch.object( - umu_util, - "setup_runtime", - return_value=None, + with ( + patch.object(umu_util, "setup_runtime", return_value=None), + patch.object(umu_util, "_update_pv", return_value=None), ): umu_util._install_umu(self.test_user_share, self.test_local_share, json) copytree( diff --git a/umu/umu_test_plugins.py b/umu/umu_test_plugins.py index 64f7235eb..86ab42c0e 100644 --- a/umu/umu_test_plugins.py +++ b/umu/umu_test_plugins.py @@ -213,10 +213,9 @@ def test_build_command_entry(self): # Mock setting up the runtime # Don't copy _v2-entry-point - with patch.object( - umu_util, - "setup_runtime", - return_value=None, + with ( + patch.object(umu_util, "setup_runtime", return_value=None), + patch.object(umu_util, "_update_pv", return_value=None), ): umu_util._install_umu(self.test_user_share, self.test_local_share, json) copytree( @@ -280,10 +279,9 @@ def test_build_command_proton(self): umu_plugins.enable_steam_game_drive(self.env) # Mock setting up the runtime - with patch.object( - umu_util, - "setup_runtime", - return_value=None, + with ( + patch.object(umu_util, "setup_runtime", return_value=None), + patch.object(umu_util, "_update_pv", return_value=None), ): umu_util._install_umu(self.test_user_share, self.test_local_share, json) copytree( @@ -351,10 +349,9 @@ def test_build_command_toml(self): umu_plugins.enable_steam_game_drive(self.env) # Mock setting up the runtime - with patch.object( - umu_util, - "setup_runtime", - return_value=None, + with ( + patch.object(umu_util, "setup_runtime", return_value=None), + patch.object(umu_util, "_update_pv", return_value=None), ): umu_util._install_umu(self.test_user_share, self.test_local_share, json) copytree(