mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-02 22:01:05 +02:00
test: align QuotaInsufficientError fixtures with balance_micros API
Billable calls now raise quota errors with balance_micros instead of used_micros/limit_micros; update mocks so CI passes on main.
This commit is contained in:
parent
fd96c930bf
commit
7a415b61ea
3 changed files with 3 additions and 6 deletions
|
|
@ -76,8 +76,7 @@ async def test_quota_denial_fails_the_podcast_without_a_transcript(
|
||||||
async def _deny(**_kwargs):
|
async def _deny(**_kwargs):
|
||||||
raise QuotaInsufficientError(
|
raise QuotaInsufficientError(
|
||||||
usage_type="podcast_generation",
|
usage_type="podcast_generation",
|
||||||
used_micros=5_000_000,
|
balance_micros=5_000_000,
|
||||||
limit_micros=5_000_000,
|
|
||||||
remaining_micros=0,
|
remaining_micros=0,
|
||||||
)
|
)
|
||||||
yield # pragma: no cover - unreachable, satisfies the CM protocol
|
yield # pragma: no cover - unreachable, satisfies the CM protocol
|
||||||
|
|
|
||||||
|
|
@ -105,8 +105,7 @@ async def test_ainvoke_propagates_quota_insufficient_error(monkeypatch):
|
||||||
async def _denying_billable_call(**_kwargs):
|
async def _denying_billable_call(**_kwargs):
|
||||||
raise QuotaInsufficientError(
|
raise QuotaInsufficientError(
|
||||||
usage_type="vision_extraction",
|
usage_type="vision_extraction",
|
||||||
used_micros=5_000_000,
|
balance_micros=5_000_000,
|
||||||
limit_micros=5_000_000,
|
|
||||||
remaining_micros=0,
|
remaining_micros=0,
|
||||||
)
|
)
|
||||||
yield # unreachable but required for asynccontextmanager type
|
yield # unreachable but required for asynccontextmanager type
|
||||||
|
|
|
||||||
|
|
@ -98,8 +98,7 @@ async def _denying_billable_call(**kwargs):
|
||||||
_CALL_LOG.append(kwargs)
|
_CALL_LOG.append(kwargs)
|
||||||
raise QuotaInsufficientError(
|
raise QuotaInsufficientError(
|
||||||
usage_type=kwargs.get("usage_type", "?"),
|
usage_type=kwargs.get("usage_type", "?"),
|
||||||
used_micros=5_000_000,
|
balance_micros=5_000_000,
|
||||||
limit_micros=5_000_000,
|
|
||||||
remaining_micros=0,
|
remaining_micros=0,
|
||||||
)
|
)
|
||||||
yield SimpleNamespace() # pragma: no cover
|
yield SimpleNamespace() # pragma: no cover
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue