Table-drive token-pattern detector tests #293
Reference in New Issue
Block a user
Delete Branch "table-drive-dlp-tests"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #289.
Summary
The token-pattern detector had 15 near-identical test methods spread across
TestScanTokenPatternsandTestScanTokenPatternsExtended— each scanned a body carrying one synthetic token and asserted the reason names the credential type.This collapses them into a single
_TOKEN_PATTERN_CASEStable driven byunittest'ssubTest, so adding a new token shape is a one-line row and a failure reports the offending case id. Each case now also asserts block severity (previously only the AWS case did).TestScanTokenPatternsExtendedis removed; its rows live in the table. The non-matrix cases (clean text, location, context, reason) stay as explicit methods.No production code change. The file drops from 110 to 96 test methods with the same coverage; full unit suite passes; pyright clean; pylint 9.95.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.