test_reports.py 453 B

123456789101112
  1. import pandas as pd
  2. from data_query_agent.reports import build_profile, write_result_files
  3. def test_empty_result_still_creates_publishable_workbook(tmp_path) -> None:
  4. frame = pd.DataFrame(columns=["date", "dau"])
  5. csv_path, xlsx_path = write_result_files(tmp_path, frame, "SELECT 1", {"run_id": "r1"})
  6. assert csv_path.stat().st_size > 0
  7. assert xlsx_path.stat().st_size > 0
  8. assert build_profile(frame, False)["returned_rows"] == 0