feat: add reminder edit and delete commands
This commit is contained in:
@@ -248,6 +248,42 @@ def test_cli_reminders_no_mcp_tool_call_remaining():
|
||||
assert 'call_macmini_tool("reminders_create"' not in src
|
||||
|
||||
|
||||
def test_cli_reminders_edit_uses_remindctl(monkeypatch):
|
||||
captured = {}
|
||||
|
||||
def fake_run(args):
|
||||
captured["args"] = args
|
||||
return {"updated": {"id": "r1", "title": "New title"}}
|
||||
|
||||
monkeypatch.setattr("reyna_cli.cli.run_remindctl", fake_run)
|
||||
res = runner.invoke(app, ["macmini", "reminders", "edit", "r1", "--title", "New title", "--due", "tomorrow", "--json"])
|
||||
|
||||
assert res.exit_code == 0
|
||||
assert captured["args"] == ["edit", "r1", "--title", "New title", "--due", "tomorrow", "--json", "--no-input"]
|
||||
assert json.loads(res.stdout)["source"] == "remindctl"
|
||||
|
||||
|
||||
def test_cli_reminders_delete_requires_force(monkeypatch):
|
||||
res = runner.invoke(app, ["macmini", "reminders", "delete", "r1", "--json"])
|
||||
|
||||
assert res.exit_code == 1
|
||||
assert "--force" in res.stdout
|
||||
|
||||
|
||||
def test_cli_reminders_delete_uses_remindctl_with_force(monkeypatch):
|
||||
captured = {}
|
||||
|
||||
def fake_run(args):
|
||||
captured["args"] = args
|
||||
return {"deleted": ["r1"]}
|
||||
|
||||
monkeypatch.setattr("reyna_cli.cli.run_remindctl", fake_run)
|
||||
res = runner.invoke(app, ["macmini", "reminders", "delete", "r1", "--force", "--json"])
|
||||
|
||||
assert res.exit_code == 0
|
||||
assert captured["args"] == ["delete", "r1", "--force", "--json", "--no-input"]
|
||||
|
||||
|
||||
def test_privacy_host_cli_has_reminders_authorize():
|
||||
res = runner.invoke(app, ["privacy-host", "--help"])
|
||||
assert res.exit_code == 0
|
||||
|
||||
Reference in New Issue
Block a user