Skip to content

Commit

Permalink
umu_test: update run_command calls to pass environment
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jul 4, 2024
1 parent 6933178 commit 1551e45
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions umu/umu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ def test_run_command(self):
mock_proc.wait.return_value = 0
mock_proc.pid = 1234
mock_popen.return_value = mock_proc
result = umu_run.run_command(mock_command)
result = umu_run.run_command(self.env, mock_command)
mock_popen.assert_called_once()
self.assertEqual(
result,
Expand Down Expand Up @@ -237,7 +237,7 @@ def test_run_command_nolibc(self):
patch.object(umu_run, "run", return_value=mock_proc),
patch.object(umu_run, "get_libc", return_value=""),
):
result = umu_run.run_command(mock_command)
result = umu_run.run_command(self.env, mock_command)
self.assertEqual(
result,
0,
Expand All @@ -247,8 +247,8 @@ def test_run_command_nolibc(self):
def test_run_command_none(self):
"""Test run_command when passed an empty list or None."""
with self.assertRaises(ValueError):
umu_run.run_command([])
umu_run.run_command(None)
umu_run.run_command(self.env, [])
umu_run.run_command(self.env, None)

def test_get_libc(self):
"""Test get_libc."""
Expand Down Expand Up @@ -1973,7 +1973,7 @@ def test_set_env_winetricks(self):

# Mock a Proton directory that contains winetricks
test_dir = Path("./tmp.aCAs3Q7rvz")
test_dir.joinpath("protonfixes").mkdir(parents=True)
test_dir.joinpath("protonfixes").mkdir(parents=True, exist_ok=True)
test_dir.joinpath("protonfixes", "winetricks").touch()

# Replicate the usage:
Expand Down Expand Up @@ -2025,7 +2025,7 @@ def test_set_env_winetricks(self):
)
self.assertEqual(
self.env["STEAM_COMPAT_INSTALL_PATH"],
str(Path.cwd()),
str(test_dir.joinpath("protonfixes").resolve()),
"Expected STEAM_COMPAT_INSTALL_PATH to be set",
)
self.assertEqual(
Expand Down

0 comments on commit 1551e45

Please sign in to comment.