From c767e4e5f92bd3a3768c4f1383400933d3df16c0 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Sat, 21 Mar 2026 19:05:40 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Palette:=20Add=20helpful=20instr?= =?UTF-8?q?uction=20to=20empty=20checkpoints=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updates the `checkpoint list` command output to provide an actionable instruction when there are no checkpoints found. Instead of just saying "No checkpoints found.", it now says "No checkpoints found. Run 'checkpoint create ' to create one." to guide the user to the correct command. Includes a test update for `test_cli_checkpoint_list_empty`. Co-authored-by: ivangegovdve-sudo <225339531+ivangegovdve-sudo@users.noreply.github.com> --- src/python_learning_orchestrated/cli.py | 5 ++++- tests/test_cli_smoke.py | 18 ++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/python_learning_orchestrated/cli.py b/src/python_learning_orchestrated/cli.py index 31751d2..676d896 100644 --- a/src/python_learning_orchestrated/cli.py +++ b/src/python_learning_orchestrated/cli.py @@ -223,7 +223,10 @@ def main( if args.checkpoint_command == "list": checkpoints = checkpoint_store.list_checkpoints() if not checkpoints: - output_fn("No checkpoints found.") + output_fn( + "No checkpoints found. " + "Run 'checkpoint create ' to create one." + ) return output_fn(f"Checkpoints ({len(checkpoints)}):") for checkpoint in checkpoints: diff --git a/tests/test_cli_smoke.py b/tests/test_cli_smoke.py index e54e34c..9622b51 100644 --- a/tests/test_cli_smoke.py +++ b/tests/test_cli_smoke.py @@ -91,6 +91,24 @@ def test_cli_export_and_import_progress_commands(tmp_path, capsys) -> None: assert len(session_payload["attempts"]) == 1 +def test_cli_checkpoint_list_empty(tmp_path, capsys, monkeypatch) -> None: + checkpoint_dir = tmp_path / "checkpoints" + + checkpoint_store_class = cli_module.CheckpointStore + monkeypatch.setattr( + cli_module, + "CheckpointStore", + lambda: checkpoint_store_class(checkpoint_dir), + ) + + main(["checkpoint", "list"]) + list_output = capsys.readouterr().out + assert ( + "No checkpoints found. Run 'checkpoint create ' to create one." + in list_output + ) + + def test_cli_checkpoint_create_and_list(tmp_path, capsys, monkeypatch) -> None: session_file = tmp_path / "session.json" checkpoint_dir = tmp_path / "checkpoints"