Skip to content

Commit

Permalink
umu_run: mock get_gamescope_baselayer_order in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
R1kaB3rN committed Jul 4, 2024
1 parent 08ea26a commit 3d37863
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion umu/umu_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ def test_run_command(self):
umu_run,
"Popen",
) as mock_popen,
patch.object(
umu_run, "get_gamescope_baselayer_order", return_value=None
),
):
mock_proc = MagicMock()
mock_proc.wait.return_value = 0
Expand Down Expand Up @@ -236,13 +239,22 @@ def test_run_command_nolibc(self):
with (
patch.object(umu_run, "Popen", return_value=mock) as proc,
patch.object(umu_run, "get_libc", return_value=""),
patch.object(
umu_run, "get_gamescope_baselayer_order", return_value=None
),
):
# TODO: Mock the call
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."""
with self.assertRaises(ValueError):
with (
self.assertRaises(ValueError),
patch.object(
umu_run, "get_gamescope_baselayer_order", return_value=None
),
):
umu_run.run_command([])
umu_run.run_command(None)

Expand Down

0 comments on commit 3d37863

Please sign in to comment.