]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-130149: refactor tests for HMAC (#130150)
authorBénédikt Tran <10796600+picnixz@users.noreply.github.com>
Mon, 3 Mar 2025 10:22:05 +0000 (11:22 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Mar 2025 10:22:05 +0000 (11:22 +0100)
commit8f11af45de68459d9d4051812aa5ddaf6a98dcb2
tree837f141619a019dc677551200e5ab38be3c4f1dc
parenta105f990199f99a352efd481ac039604feceaab5
gh-130149: refactor tests for HMAC (#130150)

Since we plan to introduce a built-in implementation for HMAC based on HACL*,
it becomes important for the HMAC tests to be flexible enough to avoid code
duplication.

In addition to the new layout based on mixin classes, we extend test coverage by
also testing the `__repr__` of HMAC objects and the HMAC one-shot functions.

We also fix the import to `_sha256` which, since gh-101924, resulted in some tests being
skipped as the module is no more available (its content was moved to the `_sha2` module).
Lib/test/support/hashlib_helper.py
Lib/test/test_hmac.py