Files
javadandCursor b93ecf1691 Initial commit of the Kamidso API.
Keep source, config, and deploy files. Leave runtime data, uploads, and logs out of git.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-10-10 13:43:09 +03:30

33 lines
1.0 KiB
Python

from pathlib import Path
from kamidso.assistant.data_sketch import compose_turn_data_sketch, paths_from_ext_info
def test_compose_sketch_includes_csv_columns_and_db_tables(tmp_path: Path):
csv_path = tmp_path / "sales.csv"
csv_path.write_text("month,amount\nFarvardin,100\nOrdibehesht,40\n", encoding="utf-8")
text = compose_turn_data_sketch(
file_paths=[str(csv_path)],
databases=[("فروش", ["invoices", "customers"])],
)
assert "This turn's data sketch" in text
assert "invoices" in text
assert "customers" in text
assert "month" in text
assert "amount" in text
assert "Do not load a skill just because data is attached" in text
def test_empty_sketch_when_nothing_attached():
assert compose_turn_data_sketch() == ""
def test_paths_from_ext_info_prefers_resolved_list():
paths = paths_from_ext_info(
{
"kamidso_resolved_file_paths": ["F:/a.xlsx"],
"file_path": "F:/legacy.csv",
}
)
assert paths == ["F:/a.xlsx"]