diff options
| author | Andrew Dolgov <fox@fakecake.org> | 2026-07-04 14:36:57 +0300 |
|---|---|---|
| committer | Andrew Dolgov <fox@fakecake.org> | 2026-07-04 14:36:57 +0300 |
| commit | 29dfc44651cf34cb6b8ee54ed223798259d6dd45 (patch) | |
| tree | e8a13bae7dae148620024be355f254509442cd12 | |
| parent | 06ecdc25e06bac8de50c9d2db64385dce358e7b7 (diff) | |
| download | fungus-launcher-29dfc44651cf34cb6b8ee54ed223798259d6dd45.tar.gz fungus-launcher-29dfc44651cf34cb6b8ee54ed223798259d6dd45.tar.xz | |
fix test for CI specifically
| -rw-r--r-- | tests/test_steamrt_timestamp.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_steamrt_timestamp.py b/tests/test_steamrt_timestamp.py index 6437bb2..8498e2f 100644 --- a/tests/test_steamrt_timestamp.py +++ b/tests/test_steamrt_timestamp.py @@ -66,14 +66,13 @@ class TestSaveSteamrtLastCheck: assert content[10] == " " assert content[13] == ":" - def test_returns_false_on_write_failure(self, patched_steamrt_file): - from fungus import umu_manager as um + def test_returns_false_on_write_failure(self, monkeypatch): from fungus.umu_manager import save_steamrt_last_check as _save - # Point to a non-writable location - um.STEAMRT_CHECK_FILE = "/root/steamrt.txt" + # Mock open to raise OSError, ensuring the test works even as root + def mock_open_raises(*args, **kwargs): + raise OSError("Permission denied") + + monkeypatch.setattr("builtins.open", mock_open_raises) result = _save() assert result is False - - # Restore - um.STEAMRT_CHECK_FILE = str(patched_steamrt_file) |
