fix(test): fix _handle_low_balance mock signature to accept positional args

The gated_processor fixture's fake_low_balance mock used **kwargs, but
production code calls _handle_low_balance with positional args via
asyncio.to_thread. This caused a silent TypeError caught by the broad
except handler, making the handle_low_balance assertion fail (0 calls
instead of 1). Updated mock to match the actual method signature.
This commit is contained in:
majdyz
2026-04-13 04:22:03 +00:00
parent 626fe17aac
commit e901b64bed

View File

@@ -492,8 +492,16 @@ def gated_processor(monkeypatch):
fake_charge_extra,
)
def fake_low_balance(self, **kwargs):
calls["handle_low_balance"].append(kwargs)
def fake_low_balance(
self, db_client, user_id, current_balance, transaction_cost
):
calls["handle_low_balance"].append(
{
"user_id": user_id,
"current_balance": current_balance,
"transaction_cost": transaction_cost,
}
)
monkeypatch.setattr(
manager.ExecutionProcessor,