Skip to content

Commit

Permalink
test: test valkey store support
Browse files Browse the repository at this point in the history
Adds (very) basic testing for the Valkey store type.
  • Loading branch information
Jordan Russell committed Dec 7, 2024
1 parent f6e9106 commit b9d9137
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion docs/examples/stores/configure_integrations_set_names.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from litestar.middleware.session.server_side import ServerSideSessionConfig
from litestar.stores.file import FileStore
from litestar.stores.redis import RedisStore
from litestar.stores.valkey import ValkeyStore

app = Litestar(
stores={"redis": RedisStore.with_client(), "file": FileStore(Path("data"))},
stores={"redis": RedisStore.with_client(), "file": FileStore(Path("data")), "valkey": ValkeyStore.with_client()},
response_cache_config=ResponseCacheConfig(store="redis"),
middleware=[
ServerSideSessionConfig(store="file").middleware,
Expand Down
2 changes: 2 additions & 0 deletions tests/examples/test_stores.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from litestar.stores.file import FileStore
from litestar.stores.memory import MemoryStore
from litestar.stores.redis import RedisStore
from litestar.stores.valkey import ValkeyStore
from litestar.testing import TestClient


Expand All @@ -16,6 +17,7 @@ async def test_configure_integrations_set_names(mock_redis: MagicMock) -> None:

assert isinstance(app.stores.get("redis"), RedisStore)
assert isinstance(app.stores.get("file"), FileStore)
assert isinstance(app.stores.get("valkey"), ValkeyStore)
assert app.stores.get("file").path == Path("data")


Expand Down

0 comments on commit b9d9137

Please sign in to comment.