Mock: Ctrl+C asks before ending and saves; validate accepts finished exercises #21

Merged
nessar merged 1 commits from cli-mock-ctrl-c into main 2026-11-26 15:56:18 +01:00
Owner

A Ctrl+C during awslings mock threw away every answer (mock #1, 26 Nov: 55 answers lost at Q56, recovered by hand from the terminal export).

  • run_mock: Ctrl+C asks "End the exam now? Your answers so far will be saved. [y/N]". No/Enter goes back to the question; yes or a second Ctrl+C ends the exam and saves, like q. Same at the flagged-review prompt. Ctrl+D (EOF) still ends without saving.
  • validate and tests/test_repo.py: the # I AM NOT DONE marker check skips exercises the learner has finished (State.is_done).
  • Tests: 3 new Ctrl+C tests; the old KeyboardInterrupt case of test_interrupt_during_the_exam_is_not_saved is now EOF-only. 79 passed.

🤖 Generated with Claude Code

A Ctrl+C during `awslings mock` threw away every answer (mock #1, 26 Nov: 55 answers lost at Q56, recovered by hand from the terminal export). - `run_mock`: Ctrl+C asks "End the exam now? Your answers so far will be saved. [y/N]". No/Enter goes back to the question; yes or a second Ctrl+C ends the exam and saves, like `q`. Same at the flagged-review prompt. Ctrl+D (EOF) still ends without saving. - `validate` and `tests/test_repo.py`: the `# I AM NOT DONE` marker check skips exercises the learner has finished (`State.is_done`). - Tests: 3 new Ctrl+C tests; the old KeyboardInterrupt case of `test_interrupt_during_the_exam_is_not_saved` is now EOF-only. 79 passed. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
nessar added 1 commit 2026-11-26 15:56:10 +01:00
A Ctrl+C during a mock threw away every answer. Ctrl+C now asks
"End the exam now? [y/N]"; yes (or a second Ctrl+C) ends the exam and
saves the answers given so far, as 'q' does. The marker check in
validate and test_repo skips exercises the learner has finished.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
nessar merged commit 7175ec5e4f into main 2026-11-26 15:56:18 +01:00
nessar deleted branch cli-mock-ctrl-c 2026-11-26 15:56:20 +01:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/awslings#21