From d63c7ce3ec81dbe70420151ea2a992b124b3cd79 Mon Sep 17 00:00:00 2001 From: aclist <92275929+aclist@users.noreply.github.com> Date: Sun, 18 Oct 2026 01:50:10 +0900 Subject: [PATCH] chore: add test --- tests/test_paused_downloads.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/test_paused_downloads.py diff --git a/tests/test_paused_downloads.py b/tests/test_paused_downloads.py new file mode 100644 index 0000000..41a32e7 --- /dev/null +++ b/tests/test_paused_downloads.py @@ -0,0 +1,27 @@ +import pytest +from pathlib import Path + +from dzgui.api.steam import is_dayz_downloading + + +@pytest.mark.parametrize( + "file_list, expect", + [ + (["state_221100_1111.patch"], True), + (["state_736_1111.patch"], False), + (["state_1024020_1111.patch"], True), + (["221100"], False), + (["221100", "state_221100_1111.patch"], True), + (["state_221100_1111.patch", "state_1024020_1111.patch"], True), + (["state_221100_1111"], False), + ], +) +def test_dayz_patch_pending(monkeypatch, file_list, expect) -> None: + def mock_get_pending_downloads(steam_path: Path, appid: int) -> None: + files = [Path(file) for file in file_list] + return files + + monkeypatch.setattr( + "dzgui.api.steam.get_pending_downloads", mock_get_pending_downloads + ) + assert is_dayz_downloading(Path("/tmp"), Path("/tmp")) == expect