mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-10 22:41:41 +00:00
test(e2e): drop the unused batch list client and fail loudly on a user teardown miss
The failed-batch redesign left list_batches, BatchList, BatchListQuery and the batch object's metadata and created_at fields with no caller, and they duplicated the batches suite's own client. delete_user discarded its result, so a user that outlived the class fixture went unnoticed; unwrap turns that into a teardown error like delete_key already does.
This commit is contained in:
parent
5db99ca7ba
commit
71cf1c7901
1 changed files with 7 additions and 26 deletions
|
|
@ -135,17 +135,6 @@ class BatchCreateBody(BaseModel):
|
|||
class BatchObject(BaseModel):
|
||||
id: str
|
||||
status: str
|
||||
metadata: dict[str, str] | None = None
|
||||
created_at: int | None = None
|
||||
|
||||
|
||||
class BatchList(BaseModel):
|
||||
data: list[BatchObject] = []
|
||||
|
||||
|
||||
class BatchListQuery(BaseModel):
|
||||
model: str
|
||||
limit: int
|
||||
|
||||
|
||||
class ProviderQuery(BaseModel):
|
||||
|
|
@ -381,11 +370,13 @@ class SpendClient:
|
|||
).user_id
|
||||
|
||||
def delete_user(self, user_id: str) -> None:
|
||||
_ = self.proxy.transport.post(
|
||||
"/user/delete",
|
||||
headers=self.proxy.transport.master,
|
||||
json=UserDeleteBody(user_ids=[user_id]),
|
||||
response_type=UserDeleteResponse,
|
||||
_ = unwrap(
|
||||
self.proxy.transport.post(
|
||||
"/user/delete",
|
||||
headers=self.proxy.transport.master,
|
||||
json=UserDeleteBody(user_ids=[user_id]),
|
||||
response_type=UserDeleteResponse,
|
||||
)
|
||||
)
|
||||
|
||||
def generate_key_record(self, body: KeyGenerateBody) -> KeyGenerateResponse:
|
||||
|
|
@ -474,16 +465,6 @@ class SpendClient:
|
|||
)
|
||||
)
|
||||
|
||||
def list_batches(self, key: str, model: str, *, limit: int) -> list[BatchObject]:
|
||||
return unwrap(
|
||||
self.proxy.transport.get(
|
||||
"/v1/batches",
|
||||
headers=self.proxy.transport.bearer(key),
|
||||
params=BatchListQuery(model=model, limit=limit),
|
||||
response_type=BatchList,
|
||||
)
|
||||
).data
|
||||
|
||||
def retrieve_batch(self, key: str, batch_id: str, *, provider: str) -> BatchObject:
|
||||
return unwrap(
|
||||
self.proxy.transport.get(
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue