From d6c15f4ea0478bc009db41a07a9ab94f29b5a006 Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Fri, 5 Jun 2026 23:21:05 -0400 Subject: [PATCH] =?UTF-8?q?test(patreon):=20fake=20gdl=20needs=20real=20?= =?UTF-8?q?=5Frate=5Flimit=20for=20native=20pacing=20=E2=80=94=20#703=20st?= =?UTF-8?q?ep=201=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit _run_patreon_ingester reads self.gdl._rate_limit for the native pacing config (max(0.5, rate_limit/4)); the MagicMock fake gdl broke the arithmetic. Give it real _rate_limit/_validate_files. Co-Authored-By: Claude Opus 4.8 (1M context) --- tests/test_download_service.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/test_download_service.py b/tests/test_download_service.py index 0befed6..0cd6cbe 100644 --- a/tests/test_download_service.py +++ b/tests/test_download_service.py @@ -84,6 +84,11 @@ def _make_fake_dl_result( def _fake_gdl_with_result(result): fake = MagicMock() fake.download = AsyncMock(return_value=result) + # Real values for the attrs _run_patreon_ingester reads off the gdl service + # (the native pacing config, plan #703) — a MagicMock would break the + # arithmetic (max(0.5, rate_limit/4)). + fake._rate_limit = 3.0 + fake._validate_files = True fake._compute_run_stats = lambda *a, **k: { "exit_code": 0, "downloaded_count": len(result.written_paths), "skipped_count": 0, "per_item_failures": 0,