Spaces:
Sleeping
Sleeping
| from pathlib import Path | |
| import pandas as pd | |
| from gaia_agent.attachments import inspect_attachment | |
| def test_inspect_workbook_reads_all_sheets(tmp_path: Path) -> None: | |
| workbook = tmp_path / "sales.xlsx" | |
| with pd.ExcelWriter(workbook) as writer: | |
| pd.DataFrame({"item": ["burger"], "sales": [12.5]}).to_excel( | |
| writer, sheet_name="Food", index=False | |
| ) | |
| result = inspect_attachment(workbook) | |
| assert "## Sheet: Food" in result | |
| assert "burger,12.5" in result | |
| def test_inspect_python_reports_output(tmp_path: Path) -> None: | |
| script = tmp_path / "calculation.py" | |
| script.write_text("print(6 * 7)\n", encoding="utf-8") | |
| result = inspect_attachment(script) | |
| assert "stdout:\n42" in result | |