Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Apr 23, 2024
1 parent 76b7c47 commit 63e6b1b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 30 deletions.
30 changes: 12 additions & 18 deletions umu/umu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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"),
Expand Down Expand Up @@ -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,
Expand All @@ -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"),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down
21 changes: 9 additions & 12 deletions umu/umu_test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 63e6b1b

Please sign in to comment.