test: comprehensive remind plugin tests with IndexError fix

Expand test coverage from 23 pure helper tests to 53 tests covering
the full plugin: _cleanup, _remind_once, _remind_repeat, and the
complete cmd_remind handler (usage, oneshot, repeating, list, cancel,
target routing). Fix IndexError on `!remind every` with no arguments.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user
2026-02-15 12:17:31 +01:00
parent 70d203f96e
commit 021a0ddbe3
2 changed files with 502 additions and 1 deletions

View File

@@ -156,7 +156,9 @@ async def cmd_remind(bot, message):
rest = parts[2] if len(parts) > 2 else ""
parts = ["", "", *rest.split(None, 1)] # re-split: [_, _, duration, text]
duration = _parse_duration(parts[1] if not repeating else parts[2])
dur_idx = 2 if repeating else 1
dur_spec = parts[dur_idx] if dur_idx < len(parts) else ""
duration = _parse_duration(dur_spec)
if duration is None:
await bot.reply(message, "Invalid duration (use: 5m, 1h30m, 2d, 90s)")
return