test: move area_cli tests into cli directory (#3842)

* test: move area_cli tests into cli directory

* test: include research CLI status in cli test move
This commit is contained in:
Alexandre Teixeira
2026-06-11 18:01:14 +01:00
committed by GitHub
parent 3e65326c3f
commit a79c0bd369
29 changed files with 7 additions and 6 deletions
+25
View File
@@ -0,0 +1,25 @@
"""Regression: research CLI summary must tolerate a non-string query.
`_summarize` did `(data.get("query") or "")[:200]`. A non-string query from a
legacy/corrupt research JSON is truthy, so `123[:200]` raised TypeError.
"""
from tests.helpers.cli_loader import load_script
def _load_cli():
return load_script("odysseus-research")
def test_preview_text_ignores_non_string():
cli = _load_cli()
assert cli._preview_text(None) == ""
assert cli._preview_text(123) == ""
assert cli._preview_text(["x"]) == ""
assert cli._preview_text("q" * 250) == "q" * 200
def test_summarize_does_not_crash_on_non_string_query():
cli = _load_cli()
out = cli._summarize("rp1", {"query": 123, "status": "done"})
assert out["query"] == ""
assert out["id"] == "rp1"