script/ptl-tool: add unit tests for the credential fail-fast fix
Extract the Redmine auth check added in the previous commit into a standalone verify_redmine_auth(R) function so it can be unit tested in isolation, and add src/script/test_ptl_tool.py covering: - verify_redmine_auth(): invalid key (AuthError), a key that authenticates but lacks permission (ForbiddenError), a valid key, and confirming unrelated Redmine errors (ServerError) still propagate normally rather than being misreported as a credentials problem. - AuditReport.post_consolidated_review(): logs success on 2xx, logs an error (rather than failing silently) on a non-2xx GitHub response, never calls out to GitHub under --dry-run, and is a no-op when the report has no issues to post. No behavior change to verify_redmine_auth() itself -- this is a pure extraction plus tests. ptl-tool.py has no existing test suite, so these are self-contained (mocked Redmine/requests, no network access, no real git checkout needed) and run with plain pytest; see the module docstring for the exact invocation. Signed-off-by: Yuri Weinstein <yweinste@redhat.com>
Y
Yuri Weinstein committed
f65b96c09799568f75a0593423c105502bdfb38b
Parent: 8bb99f9