Files
lutris/tests/runners/_test_scummvm.py
Daniel Johnson 4d0641e50b Rename the world! All unit tests will start with '_test_' to avoid ambiguity. This means stuff like 'test_config.py' will no longer be loaded as test module.
This means that very module must be explicitly loaded by various tests that need the 'gi.requires_versions' part- they no longer sometimes get this by accident (sometimes).

In turn, _test_cloud_save_progress will no longer stub stuff in sys.modules, which is awful- it breaks later tests. That in turns makes it much chattier since it now actually logs stuff. But it seems to pass for all that.

Yikes!

Resolves #6570

Much research and drudgery done by Claude Code 🤖 before it clocked out.
2026-03-24 09:20:25 -04:00

25 lines
915 B
Python

from unittest import TestCase
from unittest.mock import patch
from lutris.config import LutrisConfig
from lutris.runners.runner import Runner
from lutris.runners.scummvm import scummvm
from lutris.util.test_config import setup_test_environment
setup_test_environment()
class TestScummvm(TestCase):
def test_custom_data_dir(self):
scummvm_runner = scummvm()
scummvm_runner.config = LutrisConfig()
scummvm_runner.config.runner_config["datadir"] = "~/custom/scummvm"
with patch.object(Runner, "get_command", return_value=["scummvm"]):
self.assertEqual(scummvm_runner.get_scummvm_data_dir(), "~/custom/scummvm")
self.assertEqual(scummvm_runner.get_command()[1], "--extrapath=~/custom/scummvm")
def test_no_executable(self):
with patch.object(Runner, "get_command", return_value=[]):
self.assertEqual(scummvm().get_command(), [])