Skip to content

Commit 3491aa7

Browse files
committed
Updated optional types in test_noop_cache.py
1 parent 91436b0 commit 3491aa7

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

tests/unit/cache/test_noop_cache.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Unit tests for NoopCache class."""
22

3+
from typing import Optional
4+
35
import pytest
46

57
from models.cache_entry import CacheEntry
@@ -198,21 +200,21 @@ def test_ready(cache_fixture: NoopCache) -> None:
198200

199201

200202
@pytest.mark.parametrize("uuid", improper_user_uuids)
201-
def test_list_improper_user_id(cache_fixture: NoopCache, uuid: str | None) -> None:
203+
def test_list_improper_user_id(cache_fixture: NoopCache, uuid: Optional[str]) -> None:
202204
"""Test list with invalid user ID."""
203205
with pytest.raises(ValueError, match=f"Invalid user ID {uuid}"):
204206
cache_fixture.list(uuid)
205207

206208

207209
@pytest.mark.parametrize("uuid", improper_user_uuids)
208-
def test_delete_improper_user_id(cache_fixture: NoopCache, uuid: str | None) -> None:
210+
def test_delete_improper_user_id(cache_fixture: NoopCache, uuid: Optional[str]) -> None:
209211
"""Test delete with invalid user ID."""
210212
with pytest.raises(ValueError, match=f"Invalid user ID {uuid}"):
211213
cache_fixture.delete(uuid, CONVERSATION_ID)
212214

213215

214216
@pytest.mark.parametrize("uuid", improper_user_uuids)
215-
def test_get_improper_user_id(cache_fixture: NoopCache, uuid: str | None) -> None:
217+
def test_get_improper_user_id(cache_fixture: NoopCache, uuid: Optional[str]) -> None:
216218
"""Test how improper user ID is handled."""
217219
with pytest.raises(ValueError, match=f"Invalid user ID {uuid}"):
218220
cache_fixture.get(uuid, CONVERSATION_ID)

0 commit comments

Comments
 (0)