|
1 | 1 | """Unit tests for NoopCache class.""" |
2 | 2 |
|
| 3 | +from typing import Optional |
| 4 | + |
3 | 5 | import pytest |
4 | 6 |
|
5 | 7 | from models.cache_entry import CacheEntry |
@@ -198,21 +200,21 @@ def test_ready(cache_fixture: NoopCache) -> None: |
198 | 200 |
|
199 | 201 |
|
200 | 202 | @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: |
202 | 204 | """Test list with invalid user ID.""" |
203 | 205 | with pytest.raises(ValueError, match=f"Invalid user ID {uuid}"): |
204 | 206 | cache_fixture.list(uuid) |
205 | 207 |
|
206 | 208 |
|
207 | 209 | @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: |
209 | 211 | """Test delete with invalid user ID.""" |
210 | 212 | with pytest.raises(ValueError, match=f"Invalid user ID {uuid}"): |
211 | 213 | cache_fixture.delete(uuid, CONVERSATION_ID) |
212 | 214 |
|
213 | 215 |
|
214 | 216 | @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: |
216 | 218 | """Test how improper user ID is handled.""" |
217 | 219 | with pytest.raises(ValueError, match=f"Invalid user ID {uuid}"): |
218 | 220 | cache_fixture.get(uuid, CONVERSATION_ID) |
|
0 commit comments