mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-30 03:00:41 -04:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user