test: add unit testing

This commit is contained in:
Krrish Dholakia 2025-03-21 15:01:19 -07:00
parent dfea55a1e7
commit c7b17495a1
3 changed files with 44 additions and 14 deletions

View file

@ -32,3 +32,14 @@ def test_in_memory_openai_obj_cache():
assert cached_obj is not None
assert cached_obj == openai_obj
def test_in_memory_cache_max_size_per_item():
"""
Test that the cache will not store items larger than the max size per item
"""
in_memory_cache = InMemoryCache(max_size_per_item=100)
result = in_memory_cache.check_value_size("a" * 100000000)
assert result is False