Skip to content

Add tests for session ZIP download feature#61

Draft
Copilot wants to merge 3 commits into
mainfrom
copilot/add-download-session-zip
Draft

Add tests for session ZIP download feature#61
Copilot wants to merge 3 commits into
mainfrom
copilot/add-download-session-zip

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 4, 2026

The "Download Session" feature (ZIP archive of all session images + session.md markdown) was already implemented but lacked test coverage.

Tests added

tests/unit/test_main_helpers.py — unit tests for _build_session_markdown:

  • Basic structure (title, timestamps, token, generation count, image refs)
  • Final prompt included only when different from user prompt
  • Empty session produces valid minimal output

tests/routes/test_main_routes.py — route tests for GET /sessions/download:

  • Returns a valid ZIP containing session.md and images/ entries with correct Content-Disposition
  • Returns 400 for reserved/invalid tokens ("", "new", "all")
  • Returns 404 for unknown session token

Feature reference

The implemented feature consists of:

  • session_item.html: "Download" entry in the session menu → GET /sessions/download?session_token=<token>
  • _build_session_markdown(): Builds markdown with title, timestamps, per-generation prompts, model/provider, and image filenames
  • download_session(): Streams an in-memory ZIP (images/001.ext, …, session.md) as application/zip

Copilot AI linked an issue Apr 4, 2026 that may be closed by this pull request
Copilot AI and others added 2 commits April 4, 2026 09:34
Copilot AI changed the title [WIP] Add download whole session as ZIP functionality Add tests for session ZIP download feature Apr 4, 2026
Copilot AI requested a review from jschm42 April 4, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Download whole session as ZIP

2 participants