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.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.patch_every_gh(**mock_kwargs)[source]¶
Patch the three
ghdispatch points an issue lifecycle crosses.Listings parse through the
ghmodule, comments go through the lock recovery of the threads module, and the rest is this module’s own. One mock keeps a test’s call sequence in one list.
- tests.test_issue.test_triage_issues(issues, needed, expected)[source]¶
Triage picks the surviving issue and the ones to close.
- tests.test_issue.test_list_issues_keeps_exact_title_matches()[source]¶
The full-text search over-returns; only the exact title survives.
- tests.test_issue.test_list_issues_finds_an_open_issue_the_search_misses()[source]¶
An open issue missing from GitHub’s search index still reaches triage.
The index can leave an issue out for good. Seen by the search alone, the older duplicate is kept and updated, while the newer one stays open.
- 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.test_lifecycle_returns_the_issue_it_keeps(listing, expected_number, expected_verbs)[source]¶
The number of the issue the condition lives in comes back to the caller.
A new issue gets the assignees: an existing one keeps the assignees it has, so a re-run updates it instead of opening a second one.
- tests.test_issue.test_lifecycle_targets_the_repository_given()[source]¶
Every call of the lifecycle names the repository, when one is given.
- 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.
- 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.