mirror of
https://github.com/BerriAI/litellm.git
synced 2026-11-16 09:22:22 +00:00
test(rust): cover the OCR kill switch through the catalog and use a raw regex
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
051c88ec06
commit
09ed9bd2d6
2 changed files with 9 additions and 1 deletions
|
|
@ -97,3 +97,11 @@ def test_bedrock_transcription_ignores_the_optional_rust_switch() -> None:
|
|||
|
||||
configuration.rust(False)
|
||||
assert COMPONENTS[ComponentName.TRANSCRIPTION].resolve(context).decision is ExecutionDecision.RUST_REQUIRED
|
||||
|
||||
|
||||
def test_ocr_matches_the_legacy_gate_under_the_environment_kill_switch(monkeypatch: pytest.MonkeyPatch) -> None:
|
||||
monkeypatch.setenv("LITELLM_RUST", "0")
|
||||
configuration.rust(True)
|
||||
|
||||
assert configuration.rust_ocr_enabled() is False
|
||||
assert COMPONENTS[ComponentName.OCR].resolve().decision is ExecutionDecision.PYTHON
|
||||
|
|
|
|||
|
|
@ -114,5 +114,5 @@ def test_bind_only_allows_declared_exports(monkeypatch: pytest.MonkeyPatch) -> N
|
|||
component: Final = NativeComponent(name=ComponentName.TOKEN_COUNTER, capability=OPT_IN, exports=("route",))
|
||||
|
||||
assert component.bind("route", validate=lambda value: value if isinstance(value, int) else None).load() == 3
|
||||
with pytest.raises(ValueError, match="'other'.*token_counter"):
|
||||
with pytest.raises(ValueError, match=r"'other'.*token_counter"):
|
||||
component.bind("other", validate=lambda value: value)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue