From 2f2820eb339a6dda663b9b0f173e849a55c5de0f Mon Sep 17 00:00:00 2001 From: 9qeklajc Date: Tue, 4 Aug 2026 01:44:01 +0200 Subject: [PATCH] fix test --- tests/unit/test_auto_topup.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/unit/test_auto_topup.py b/tests/unit/test_auto_topup.py index 208156c9..0db7408f 100644 --- a/tests/unit/test_auto_topup.py +++ b/tests/unit/test_auto_topup.py @@ -232,6 +232,10 @@ async def test_ppq_auto_topup_pays_invoice_and_confirms_settlement() -> None: "routstr.upstream.auto_topup.maximum_owner_cashu_balance_sats", AsyncMock(return_value=10_000), ), + patch( + "routstr.upstream.auto_topup._ppq_spent_last_24h_usd", + AsyncMock(return_value=0.0), + ), patch( "routstr.upstream.auto_topup.prepare_bolt11_payment", AsyncMock(return_value=plan), @@ -295,6 +299,10 @@ async def test_ppq_ambiguous_melt_keeps_claim_and_emits_critical_alert() -> None "routstr.upstream.auto_topup.maximum_owner_cashu_balance_sats", AsyncMock(return_value=10_000), ), + patch( + "routstr.upstream.auto_topup._ppq_spent_last_24h_usd", + AsyncMock(return_value=0.0), + ), patch( "routstr.upstream.auto_topup.prepare_bolt11_payment", AsyncMock(return_value=plan), @@ -359,6 +367,10 @@ async def test_ppq_payment_not_attempted_releases_claim_for_retry() -> None: "routstr.upstream.auto_topup.maximum_owner_cashu_balance_sats", AsyncMock(return_value=10_000), ), + patch( + "routstr.upstream.auto_topup._ppq_spent_last_24h_usd", + AsyncMock(return_value=0.0), + ), patch( "routstr.upstream.auto_topup._claim_ppq_topup", AsyncMock(return_value="operation-1"), @@ -420,6 +432,10 @@ async def test_ppq_status_error_after_payment_marks_reconcile_and_alerts() -> No "routstr.upstream.auto_topup.maximum_owner_cashu_balance_sats", AsyncMock(return_value=10_000), ), + patch( + "routstr.upstream.auto_topup._ppq_spent_last_24h_usd", + AsyncMock(return_value=0.0), + ), patch( "routstr.upstream.auto_topup._claim_ppq_topup", AsyncMock(return_value="operation-1"), @@ -650,6 +666,10 @@ async def test_settled_topup_alerts_when_its_claim_was_already_released() -> Non "routstr.upstream.auto_topup.maximum_owner_cashu_balance_sats", AsyncMock(return_value=10_000), ), + patch( + "routstr.upstream.auto_topup._ppq_spent_last_24h_usd", + AsyncMock(return_value=0.0), + ), patch( "routstr.upstream.auto_topup.execute_bolt11_payment", AsyncMock(return_value=(101, "https://mint-rich.test", "sat")),