From c865637b8efadb4aa88c4acb9ce85dd1f058349f Mon Sep 17 00:00:00 2001 From: NikkeDoy Date: Tue, 9 Jun 2026 19:38:50 +0300 Subject: [PATCH] :shield: | Fix security hotspot - replace /tmp path with tmp_path --- tests/test_gui_widgets.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_gui_widgets.py b/tests/test_gui_widgets.py index 46ebf35..a07ea47 100644 --- a/tests/test_gui_widgets.py +++ b/tests/test_gui_widgets.py @@ -468,12 +468,14 @@ class TestAudioPlayer: assert isinstance(task_id, int) assert song["videoId"] == "prefetch_test" - def test_on_download_succeeded_prefetch(self, player): + def test_on_download_succeeded_prefetch(self, player, tmp_path): """_on_download_succeeded caches prefetch result.""" + temp_file = tmp_path / "test.mp3" + temp_file.write_text("audio") player._prefetch_task_id = 55 player._queue = [{"videoId": "prefetch_vid"}] player._on_download_succeeded(55, {"videoId": "prefetch_vid", - "_local_path": "/tmp/test.mp3"}) + "_local_path": str(temp_file)}) assert "prefetch_vid" in player._prefetch_cache assert player._prefetch_task_id is None