- Cover the new utilities helpers (unpad, crc32, checksumPid type preservation, pidFromSerial, safe_join) and drop the now-redundant per-module crc32 tests. - Rename test_unpad_removes_pkcs7_padding to reflect that unpad only trusts the trailing pad-length byte rather than validating PKCS#7. - Replace the KOBO_HASH_KEYS change-detector with a test that documents the intentional value pin and checks the ASCII-salt contract. - Note kgenpids' hybrid import in the test-loader docstring. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
16 lines
366 B
Python
16 lines
366 B
Python
"""Tests for kindlepid PID/serial helpers."""
|
|
|
|
import dedrm_test_utils as U
|
|
|
|
kp = U.load("kindlepid", package="dedrm")
|
|
|
|
|
|
def test_checksum_pid_appends_two_chars():
|
|
pid = kp.checksumPid(b"12345678")
|
|
assert pid == b"12345678EL"
|
|
assert len(pid) == 10
|
|
|
|
|
|
def test_pid_from_serial_known_vector():
|
|
assert kp.pidFromSerial(b"B00212345678", 8) == b"VBKTRX7Q"
|