| 1 | from __future__ import annotations |
| 2 | |
| 3 | import sys |
| 4 | from pathlib import Path |
| 5 | |
| 6 | import pytest |
| 7 | |
| 8 | PROJECT_ROOT = Path(__file__).resolve().parents[1] |
| 9 | if str(PROJECT_ROOT) not in sys.path: |
| 10 | sys.path.insert(0, str(PROJECT_ROOT)) |
| 11 | |
| 12 | from helpers import persist_chat |
| 13 | |
| 14 | |
| 15 | @pytest.mark.parametrize("ctxid", [None, "", " "]) |
| 16 | def test_chat_deletion_rejects_empty_context_ids(ctxid) -> None: |
| 17 | with pytest.raises(ValueError, match="context id must not be empty"): |
| 18 | persist_chat.remove_chat(ctxid) |
| 19 | with pytest.raises(ValueError, match="context id must not be empty"): |
| 20 | persist_chat.remove_msg_files(ctxid) |