mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-13 08:52:02 +00:00
test(batches): give poller test rows the stored batch every managed batch row carries
This commit is contained in:
parent
de995b48e8
commit
2184695446
1 changed files with 13 additions and 1 deletions
|
|
@ -2917,6 +2917,7 @@ class TestPollPageStarvation:
|
||||||
created_at=now - age,
|
created_at=now - age,
|
||||||
updated_at=now,
|
updated_at=now,
|
||||||
status="in_progress",
|
status="in_progress",
|
||||||
|
file_object={},
|
||||||
)
|
)
|
||||||
for name, age in (("old", timedelta(days=3)), ("new", timedelta(hours=1)))
|
for name, age in (("old", timedelta(days=3)), ("new", timedelta(hours=1)))
|
||||||
)
|
)
|
||||||
|
|
@ -2943,6 +2944,7 @@ class TestPollPageStarvation:
|
||||||
created_at=now - age,
|
created_at=now - age,
|
||||||
updated_at=now,
|
updated_at=now,
|
||||||
status="in_progress",
|
status="in_progress",
|
||||||
|
file_object={},
|
||||||
)
|
)
|
||||||
for name, age in ages.items()
|
for name, age in ages.items()
|
||||||
)
|
)
|
||||||
|
|
@ -3787,8 +3789,18 @@ class TestMultiPodBatchCostClaim:
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
@pytest.mark.parametrize("has_batch_processed_column", (True, False))
|
@pytest.mark.parametrize("has_batch_processed_column", (True, False))
|
||||||
async def test_billing_a_batch_keeps_the_endpoint_it_was_created_for(self, has_batch_processed_column: bool) -> None:
|
async def test_billing_a_batch_keeps_the_endpoint_it_was_created_for(self, has_batch_processed_column: bool) -> None:
|
||||||
|
from litellm.types.utils import LiteLLMBatch
|
||||||
|
|
||||||
row: Final = _FakeManagedObjectRow()
|
row: Final = _FakeManagedObjectRow()
|
||||||
row.file_object = json.dumps({**json.loads(row.file_object), "endpoint": "/v1/embeddings"})
|
row.file_object = LiteLLMBatch(
|
||||||
|
id="batch-456",
|
||||||
|
status="in_progress",
|
||||||
|
input_file_id="file-input-1",
|
||||||
|
endpoint="/v1/embeddings",
|
||||||
|
completion_window="24h",
|
||||||
|
created_at=1,
|
||||||
|
object="batch",
|
||||||
|
).model_dump_json()
|
||||||
instance: Final = self._instance(self._prisma(row, []), self._router())
|
instance: Final = self._instance(self._prisma(row, []), self._router())
|
||||||
instance._has_batch_processed_column = has_batch_processed_column
|
instance._has_batch_processed_column = has_batch_processed_column
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue