mirror of
https://github.com/NousResearch/hermes-agent.git
synced 2026-05-02 02:01:47 +00:00
Merge e722384ad9 into fd10463069
This commit is contained in:
commit
e18b3d42da
2 changed files with 28 additions and 1 deletions
|
|
@ -541,7 +541,7 @@ def _cmd_cleanup(args):
|
||||||
)
|
)
|
||||||
print_info("Stop OpenClaw first: systemctl --user stop openclaw-gateway.service")
|
print_info("Stop OpenClaw first: systemctl --user stop openclaw-gateway.service")
|
||||||
print()
|
print()
|
||||||
if not auto_yes:
|
if not auto_yes and not dry_run:
|
||||||
if not sys.stdin.isatty():
|
if not sys.stdin.isatty():
|
||||||
print_info("Non-interactive session — aborting. Stop OpenClaw and re-run.")
|
print_info("Non-interactive session — aborting. Stop OpenClaw and re-run.")
|
||||||
return
|
return
|
||||||
|
|
|
||||||
|
|
@ -583,6 +583,33 @@ class TestCmdCleanup:
|
||||||
assert not openclaw.exists()
|
assert not openclaw.exists()
|
||||||
assert not clawdbot.exists()
|
assert not clawdbot.exists()
|
||||||
|
|
||||||
|
def test_dry_run_still_shows_preview_when_running_in_non_interactive_session(self, tmp_path, capsys):
|
||||||
|
openclaw = tmp_path / ".openclaw"
|
||||||
|
openclaw.mkdir()
|
||||||
|
ws = openclaw / "workspace"
|
||||||
|
ws.mkdir()
|
||||||
|
(ws / "todo.json").write_text("{}")
|
||||||
|
|
||||||
|
args = Namespace(source=None, dry_run=True, yes=False)
|
||||||
|
fake_stdin = MagicMock()
|
||||||
|
fake_stdin.isatty.return_value = False
|
||||||
|
|
||||||
|
with (
|
||||||
|
patch.object(claw_mod, "_find_openclaw_dirs", return_value=[openclaw]),
|
||||||
|
patch.object(
|
||||||
|
claw_mod,
|
||||||
|
"_detect_openclaw_processes",
|
||||||
|
return_value=["openclaw process(es) (PIDs: 1234)"],
|
||||||
|
),
|
||||||
|
patch("sys.stdin", fake_stdin),
|
||||||
|
):
|
||||||
|
claw_mod._cmd_cleanup(args)
|
||||||
|
|
||||||
|
captured = capsys.readouterr()
|
||||||
|
assert "OpenClaw appears to be still running" in captured.out
|
||||||
|
assert "Non-interactive session — aborting" not in captured.out
|
||||||
|
assert "Would archive" in captured.out
|
||||||
|
|
||||||
|
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
# _print_migration_report
|
# _print_migration_report
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue