mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-11 03:38:38 +00:00
test: add Final annotations to LIT-5757 regression test variables
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
0585c45cd9
commit
4a43b50800
1 changed files with 4 additions and 3 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import os
|
||||
import sys
|
||||
from typing import Final
|
||||
|
||||
import pytest
|
||||
|
||||
|
|
@ -82,19 +83,19 @@ def test_prompt_tokens_details_maps_nested_cache_creation_input_tokens():
|
|||
overriding an explicitly provided canonical value."""
|
||||
from litellm.types.utils import PromptTokensDetailsWrapper
|
||||
|
||||
nested = PromptTokensDetailsWrapper(
|
||||
nested: Final = PromptTokensDetailsWrapper(
|
||||
cached_tokens=0, text_tokens=2059, cache_creation_input_tokens=2048
|
||||
)
|
||||
assert nested.cache_write_tokens == 2048
|
||||
assert nested.cache_creation_tokens == 2048
|
||||
|
||||
explicit = PromptTokensDetailsWrapper(
|
||||
explicit: Final = PromptTokensDetailsWrapper(
|
||||
cache_write_tokens=100, cache_creation_input_tokens=2048
|
||||
)
|
||||
assert explicit.cache_write_tokens == 100
|
||||
assert explicit.cache_creation_tokens == 100
|
||||
|
||||
non_int = PromptTokensDetailsWrapper(cache_creation_input_tokens=None)
|
||||
non_int: Final = PromptTokensDetailsWrapper(cache_creation_input_tokens=None)
|
||||
assert not hasattr(non_int, "cache_write_tokens")
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue