Skip to content

Commit

Permalink
umu_test: update run_command test
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jul 4, 2024
1 parent 47ccf18 commit 815d0c2
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions umu/umu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,19 +230,15 @@ def test_run_command_nolibc(self):
"/home/foo/.local/share/Steam/compatibilitytools.d/GE-Proton9-7/proton",
mock_exe,
]
mock_proc = CompletedProcess(mock_command, 0)
mock = MagicMock()

os.environ["EXE"] = mock_exe
with (
patch.object(umu_run, "run", return_value=mock_proc),
patch.object(umu_run, "Popen", return_value=mock) as proc,
patch.object(umu_run, "get_libc", return_value=""),
):
result = umu_run.run_command(mock_command)
self.assertEqual(
result,
0,
"Expected 0 status code when libc could not be found",
)
umu_run.run_command(mock_command)
proc.assert_called_once()

def test_run_command_none(self):
"""Test run_command when passed an empty list or None."""
Expand Down

0 comments on commit 815d0c2

Please sign in to comment.