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:
Yujong Lee 2026-09-15 04:18:57 +00:00
parent 051c88ec06
commit 09ed9bd2d6
2 changed files with 9 additions and 1 deletions

View file

@ -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

View file

@ -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)