import sqlite3
import time
from types import SimpleNamespace
from fastapi import HTTPException
from backend.generation_errors import generation_failure
from backend.store import Store
from tests.test_api_publication import setup,client,fixture_generation
def test_quota_is_actionable_without_raw_html_or_credentials():
e=SimpleNamespace(title='ZeroGPU quota exceeded',message='You have exceeded your free ZeroGPU quota (120s requested vs. 87.5s left). Try again in 0:23:05. token')
now=time.time();f=generation_failure(e,'inference')
assert f.code=='gpu_quota' and '120 seconds' in f.message and '87.5 seconds' in f.message
assert now+1384