mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-13 03:59:12 +00:00
* refactor(rust_bridge): group the Python modules Rust imports by name under rust_bridge/host Rust reads Python-owned state (legacy callback registries, model capabilities) through modules it imports by path. Put them in one folder with an AGENTS.md that states the contract, and update the module path constants on the Rust side. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> * refactor(rust_bridge): route Python state reads through host accessors * docs(rust_bridge): point test_support at the moved host contract test Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * refactor(rust_bridge): move secret manager, transport and timeout accessors under host Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> * chore(greptile): register rust_bridge/host AGENTS.md in files.json Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --------- Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com> Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
21 lines
727 B
Python
21 lines
727 B
Python
from typing import Final
|
|
|
|
import pytest
|
|
|
|
import litellm
|
|
from litellm.caching.caching import Cache
|
|
from litellm.rust_bridge.host.cache import configured_cache
|
|
from litellm.types.caching import LiteLLMCacheType
|
|
|
|
|
|
def test_configured_cache_preserves_identity_and_observes_runtime_replacement(monkeypatch: pytest.MonkeyPatch) -> None:
|
|
initial: Final = Cache(type=LiteLLMCacheType.LOCAL)
|
|
replacement: Final = Cache(type=LiteLLMCacheType.LOCAL)
|
|
monkeypatch.setattr(litellm, "cache", initial)
|
|
assert configured_cache() is initial
|
|
|
|
monkeypatch.setattr(litellm, "cache", replacement)
|
|
assert configured_cache() is replacement
|
|
|
|
monkeypatch.setattr(litellm, "cache", None)
|
|
assert configured_cache() is None
|