mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-12 03:48:56 +00:00
* test: move 76 live top-level tests to offline unit and integration coverage * test: keep the mock-param opt-in guard valid once the top-level senders are gone * test: address review on offline replacements * docs(test): drop the deleted harness test file from the harness check command * test: make the key rebind, team member delete and routes integration tests exercise the legacy paths * test: make fallback, rpm and spend integration contracts deterministic and clean up their rows, assert the rpm limit in usage-based routing * test: expect the no-deployments error at the rpm limit and cover the strategy check without pre-call checks * test: hand member cleanups to the scenario instead of growing a budget list, flatten callback kinds * test: scope the admin health check to the test's own deployment --------- Co-authored-by: yuneng <yuneng@berri.ai>
26 lines
863 B
Python
26 lines
863 B
Python
from __future__ import annotations
|
|
|
|
from typing import Final
|
|
|
|
from .models import Coverage, HarnessCase, HarnessRun, RunStatus
|
|
from .strategy import ModuleCaseSpec
|
|
from .ui import _format_duration, _summary
|
|
|
|
|
|
def test_should_format_developer_facing_run_context() -> None:
|
|
run: Final = HarnessRun.from_cases(
|
|
(
|
|
HarnessCase(
|
|
strategy_id="example",
|
|
strategy_label="Example",
|
|
sdk_function="messages",
|
|
spec=ModuleCaseSpec(coverage=Coverage.COMPLETE, module="tests.example"),
|
|
),
|
|
)
|
|
)
|
|
result: Final = next(iter(run.results.values()))
|
|
result.collected.add("tests/test_parity.py::test_one")
|
|
result.record("tests/test_parity.py::test_one", RunStatus.PASSED, 1.25)
|
|
|
|
assert _summary(run) == (1, 0, 0, 0)
|
|
assert _format_duration(1.25) == "1.2s"
|