tests.test_issue moduleΒΆ
Tests for repomatic.github.issue.
- tests.test_issue.TITLE = 'Papaya harvest report'ΒΆ
Arbitrary issue title the triage tests match against.
- tests.test_issue.test_triage_issues(issues, needed, expected)[source]ΒΆ
Triage picks the surviving issue and the ones to close.
- tests.test_issue.test_lifecycle_trims_oversized_body_before_writing()[source]ΒΆ
Oversized issue bodies are trimmed before they ever reach
gh.The GitHub API rejects bodies over the size limit outright, so the lifecycle helper fits the rendered body before writing it to disk, marking the cut with a truncation notice.
- tests.test_issue.LOCKED_ERROR_MESSAGE = 'GraphQL: Unable to create comment because issue is locked (addComment)'ΒΆ
Verbatim
ghfailure when GitHub refuses a comment on a locked conversation.
- tests.test_issue.COMMENTING_OPERATIONS = (((<function <lambda>>, 'close'), (), 'close_issue'), ((<function <lambda>>, 'reopen'), (), 'reopen_issue'))ΒΆ
Every wrapper that posts a comment, and the
gh issueverb it invokes.
- tests.test_issue.test_locked_conversation_is_unlocked_then_retried(operation, verb)[source]ΒΆ
A lock blocking a comment is cleared, then the original write replayed.
- tests.test_issue.test_unlocked_conversation_costs_no_extra_call(operation, verb)[source]ΒΆ
The common path stays a single
ghcall: no speculative unlock.
Only a lock triggers the unlock: every other failure surfaces as-is.
- tests.test_issue.test_lock_surviving_the_unlock_still_raises(operation, verb)[source]ΒΆ
The retry is bounded to one: a lock that outlives the unlock is fatal.
- tests.test_issue.test_locked_closed_issue_is_reopened_and_updated()[source]ΒΆ
A closed issue locked by the autolock workflow still gets reopened.
Reproduces the deadlock between two components this project ships: the autolock job locks a recurring issue 90 days after it closes, then the checker that owns the issue needs to reopen it when the condition recurs and has its reopen comment refused.
- tests.test_issue.test_create_issue_reads_the_number_off_the_url_line(tmp_path, output, expected)[source]ΒΆ
The issue number comes from the URL line, whatever gh printed above it.
- tests.test_issue.test_create_issue_rejects_unparsable_output(tmp_path, output)[source]ΒΆ
No readable number raises, rather than returning a bogus issue number.
- tests.test_issue.test_search_window_counts_back_from_today()[source]ΒΆ
The
updated:<cutoff isinactive_daysbefore now, not a fixed date.
- tests.test_issue.test_each_kind_is_commented_then_locked_with_its_own_wording(is_pr, kind, comment)[source]ΒΆ
Issues and PRs take the
ghverb and the comment that match their kind.
- tests.test_issue.test_excluded_labels_spare_a_thread(labels, expected)[source]ΒΆ
A thread carrying an excluded label is reported, never written to.
The default exclusion is the bot label, because those issues are designed to reopen when their condition recurs and a lock refuses the reopen comment.
- tests.test_issue.test_dry_run_reports_without_writing()[source]ΒΆ
The default mode searches and reports, and never comments or locks.
- tests.test_issue.test_empty_comment_skips_the_comment_call()[source]ΒΆ
Locking silently is one call, not a comment with an empty body.
- tests.test_issue.test_every_write_names_the_repository()[source]ΒΆ
ghresolves a repo from the checkout: the locker never relies on that.The autolock job runs on a schedule with no pull request in sight, and a downstream caller may point the command at another repository entirely, so the slug travels on each call rather than through the working directory.