2026-06-04 15:44:25 +01:00
|
|
|
from tests.helpers.cli_loader import load_script
|
|
|
|
|
from tests.helpers.db_stubs import make_core_db_stub
|
2026-06-03 08:06:49 +03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def test_preview_text_ignores_non_string_values(monkeypatch):
|
2026-06-04 15:44:25 +01:00
|
|
|
make_core_db_stub(monkeypatch, models=["ScheduledTask", "TaskRun"])
|
|
|
|
|
cli = load_script("odysseus-tasks")
|
2026-06-03 08:06:49 +03:00
|
|
|
|
|
|
|
|
assert cli._preview_text(None) == ""
|
|
|
|
|
assert cli._preview_text({"bad": "row"}) == ""
|
|
|
|
|
assert cli._preview_text("x" * 201) == ("x" * 200) + "…"
|