File size: 741 Bytes
6f718f1
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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