Skip to content

Add idempotent command tests and docstring guidance#212

Merged
jtdub merged 2 commits intomasterfrom
issue61
Mar 20, 2026
Merged

Add idempotent command tests and docstring guidance#212
jtdub merged 2 commits intomasterfrom
issue61

Conversation

@jtdub
Copy link
Contributor

@jtdub jtdub commented Mar 20, 2026

Summary

  • Closes Idempotent command handling enhancements #61: All three sub-items are addressed
    • Item 1 (parameterized regex): Already works via capture groups — added tests proving it
    • Item 2 (single-match-per-rule clarity): Updated IdempotentCommandsRule docstring with best practices
    • Item 3 (remove lineage keyword): Already resolved by migration to Pydantic models
  • Added 4 new tests in tests/test_idempotent_commands.py:
    • Parameterized regex: same capture group key is idempotent
    • Parameterized regex: different capture group keys are independent
    • BGP neighbor remote-as idempotency per neighbor IP
    • Cross-contamination safety between separate startswith rules

Test plan

  • poetry run pytest tests/test_idempotent_commands.py -v — all 4 tests pass
  • poetry run ./scripts/build.py lint-and-test — full suite passes

🤖 Generated with Claude Code

jtdub and others added 2 commits March 19, 2026 20:29
Add tests demonstrating parameterized regex idempotency, BGP neighbor
idempotency, and cross-contamination safety between separate rules.
Update IdempotentCommandsRule docstring with usage guidance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add CLAUDE.md for Claude Code guidance. Update docs to reflect
exit_text_parent_level on SectionalExitingRule, fix inaccurate XR
indent-adjust description, and add HP Comware5 to README platforms.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jtdub jtdub merged commit b7ab275 into master Mar 20, 2026
5 checks passed
@jtdub jtdub deleted the issue61 branch March 20, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Idempotent command handling enhancements

1 participant